[FIX] Caching issues with hybrid templates

* Create subfolders for cache/compiled files for themes

Fixes #1016 once merged.