I guess this wasn't caught in the initial review, but we should we a templates rather than generating HTML by hand. Check out [Hogan](http://twitter.github.io/hogan.js/)