Switching to jade template engine and refactoring app