A little refactoring to the templates and added a .when for ever page in the app to hub.js