Add Template Engine

Rearrange the site initialization, moving everything into classes. Add
ability to determine which template file to serve based on query
parameters.