Added support for dynamic caching of hierarchies that are slow to calculate.