Added caching to theme folder support

Added the use of the cache object to store templates that have already
been resolved in the theme folder