Refactor maps js into reusable generator object. Refactor views.