Continued refactoring Relation/ReferenceMap classes (almost done)