Non-JS compatibility.
Lots of fixes to JSON hierarchy caches.

Live cache creation if cache files don't exist. Large refactoring. Error message fixes.