Topic/better metadata tests

(split out of an older PR that had a bunch of other stuff jammed in it too)

Tests hashes more completely, and uses Test::Deep plugins for YAML and JSON rather than decoding ourselves.