More refactoring, moving client templating to Mustache.js