Refactors geolocation functionality

Refactors geolocation to generalize the geolocation button script so it
can be shared more easily between the homepage and inside pages, and
anywhere else it may be needed.
Test cleanup

Removes unnecessary code in scripts and fixes outdated code comments.