Fix the custom field merging code (LT-15777, LT-15779)

* Change the way custom fields are mapped onto the model to
  improve the ability to find places they belong.
* Fix one of the unit tests for custom field mapping so it works
  with a more realistic model.
* Move where custom fields are merged into the model so switching
  between configurations in the configuration dialog works.
* Add expected sub nodes on custom fields that reference list items.

Change-Id: I14003cd4417b9301c6ec10a72b460705b009b2cd