Fixed some of the issues with geofences.  Also I cleaned up a bunch of
the methods and variables that were not used/replaced.

Also, added some comments for documentation purposes.