Refactored cache in KCVS, implemented new typecache