caching classes and mechanism working. Need to think about finalizers on the ref classes and whether they should write to disk or not