Add support for different template engines

This adds a hook which allows extensions to use a custom parser or template engine for some or all files.