Mongoid changed criteria_instance_id to __selected_fields
Merge branch 'removing-identity-map' of https://github.com/deevis/mongoid-versioning
Follow upstream change: rename metadata to relation_metadata.