Generate HTML using dom api.

- [X] Use dom apt to generate the html instead of ugly string concatenation.
- [ ] Styles are a little misaligned.
- [ ] Update mocha tests to use jsdom properly.