Add mapper lib

* made all templates use a base layout.
* reorganized handlers and models into separate files.
* Working QueryMapper() class using deferred to count entities and store in a counter table.