Refactor rendering to use handlebars.js templates
Remove some dead code from template update