refactor: requirejs, handlebars, general cleanup