Nearby refactor

I've refactored the geo.js code so that it can be used on the Wikipedia mobile site.
Note the outstanding todo note in b0df6a3db26dad26667e74c5e094af537f0852dc