Add AttrCache, fix Index and Repository classes