Add great circle distances for location, clean up code a great deal

Just for fun ;-)