Added CachedTree object and tests