Use underscore.js for templates

Similar changes will have to be made for ruby, as well.