Bug 906756 - Algorithms for merging givenName and familyName changed.

New tests added.
Adapt and merge changed to allow specifying the master contact.
Name composition centralized to avoid code repetition.