Add abstract Template class and implementations

Move the handling and rendering of the template to its own class. The
implementations are not yet complete.