Template injection

This adds a mechanism for injecting templates from plugins into the themes.

Using it, plugins can define their own specific templates for pages they want to generate, which can still be override by themes, or the user's ``templates/`` folder.