Refactored CachedTree, added support for entity serialization via JSON