Test and solution for merge sense problem

* When senses that were Components of other entries
  were merged there was a crash caused by RemoveObject
  side effects
* Fixed ReplaceReferences in CmObject to not crash by handling
  ReferenceSequence references differently
* Changed a merge entries test and explained it a bit
* Some minor refactoring

Change-Id: I29563648e66bde5d13cc2e1c81c75260650c5e72