added support for accessing templates via $templateCache