TemplateEngine improvements. Semi working page generation