Replace all HTML in index.php with templates

Fixes issue #23.

I've implemented a default template, which produces almost exactly the same output as the current master branch does. After formatting the HTML output from this branch compared to the master branch, there is almost zero difference. I've added a class attribute in a couple of places, but otherwise it is semantically and practically the same.

I'll get around to writing a wiki article explaining the template syntax over the next week, but you'll probably get a good feel for it by looking at the template files themselves.

I'll also submit a PR for an additional theme in the near future, but decided to get this merged first, to prevent further merge conflicts as you work on the code. The only real reason I wanted to have another template ready when I was merging this was to show off how it is possible to create additional tempaltes. But I get the feeling you are already aware of how it will work, so will not bother holding up these changes.

Sorry for the monster changes, I wasn't sure whether to do them in small bunches, but I figured it would be better to replace all the HTML at once, rather than continually submit PRs with more templating coverage.