to_hash now only serializes attributes defined in the BaseEntity instead of all instance variables;  to_nested_hash leaves LazyEntityReferences unresolved; Equality for LazyEntityReference and Version