Allow template cache reset

This is needed to allow loading/unloading of templates in tests