what is the history of the magnetic compass