Allow YAML hashes to work with hierarchical host/group vars

As the inventory allows hashes (or associate arrays), when used in
a hierarchy the hashes should be merged (previous situation was that
the new hash replaced the old one entirely).

As this isn't simple, I've added test cases which I'm pleased to report
failed before the code fix and pass afterwards

Basic idea in JSON:

parent group:
  properties = { 'keyA': 'x', 'keyB': 'y' }

child group:
  properties = { 'keyB': 'z', 'keyC': 'a' }

After the merge we expect
  properties = { 'keyA': 'x', 'keyB': 'z', 'keyC': 'a' }

previously the result would have just been the child properties, losing keyA