Revert "Remove deprecated Template and TemplateLoader"

This reverts commit 94eca2ce4494a19bf45502600ed40c1faa683d75.