Next version that is based on html/template.

WIP, much refactoring and cleaning up to be done.