title bugfix
Change main template to two step compilation.

Some template variables never change during the app's lifetime, so they can be precompiled.
Other variables change for each request, so they must be compiled for every request.