Cleaned up code a bit to be more pythonic and DRY. Also added geocoding to country, subdivision, and locality