Cleanup pasting from dialogs (part 1)

This is a foundation to fix fisharebest/webtrees/pull/113#issuecomment-35833404
None of this work was specifically targeted at autocomplete. I was focusing on pasting values from dialogs first and untangling the mess of duplicated paste functions. Now that I have a better understanding how all of this works, I can refactor more and fix [bug 758731](https://bugs.launchpad.net/webtrees/+bug/758731) if I don't end up fixing it by accident along the way. I didn't yet update the descriptions below the XREF field for field types that didn't already have an argument in PHP to specify one since I will be cleaning up how that works soon (see c024868).

It's probably easiest to review the individual commits as they are self-contained.