http://underscorejs.org/#template

mustache seems also popular now. http://mustache.github.io/

I would put the html aside from javascript code. See this post for example (see section "Would you declare your JavaScript in HTML?").

http://en.wikipedia.org/wiki/Javascript_templating

However, if this is the only place where you intend to use this, I would not add a new dependency. What do you think? Which other pages should oq-engine-server serve? Isn'it a responsability of oq-platform?