Modularise geolocation related code, add client-side templating
final updates