fixes #336, use only 1 instance of the template engine
adds the ability to override the head route