In-progress refactoring of gmaps.js