Refactoring main_app.jinja into the master template that it is.