changing template system form handlebars to javascript