Add better XML metadata info based on the Library of Congress "MIX" schema

This is only partial support. Also contains some extract-method refactoring to make it easier to maintain.

Thanks to Phillip Klinefelter and Ashraf Barakat for assistance on this.