[FIX] Caching issues with hybrid templates

* Create subfolders for cache/compiled files for themes

Fixes #1016 once merged.
Merge pull request #1264 from TheSerapher/issue-1016

[FIX] Caching issues with hybrid templates