IPTC (especially XMP) metadata overhaul

Some things that Dan Wexler and I were working on over the weekend.

The XMP we were outputting was not well formatted and generally wasn't read by other apps.  I hadn't noticed this before because I usually output both IIM and XMP, there's lots of redundancy between the two, and the IIM was fine.  But metadata that is supported by XMP only was getting lost.

This largely rewrites the XMP generation, and also much of the parsing, fixes a lot of bugs.

It's not perfect, but it's mostly working now, certainly a big improvement on what was there before.