JSON Hierarchy Cache

Converted the hierarchy cache to JSON for speed on both ends (importing and exporting) and cache size improvements.