Generate templates dynamically

This patch makes it possible to generate HTML from rST programmatically
(i.e. in Python), which eliminates the need to compile templates from
the command line.

Closes #6.