Added ability to execute templates from resources.