[templates] Switch to handlebars templates, with precompilation