Adding template cache and fixing view management

This PR adds a template cache as proposed in #27.

The template cache will not load cached templates for edit views.

It also fixes the view management for going from Login --> Main application view.

Fixes #27.