Refactor metadata formats to be smaller

- formats now merely implement an interface
- the relevant element and Item data is passed directly to
  appendMetadata, not set on the format
- formats are registered manually and filtered
Extend DOMElement for convenience methods

Compared to relying on methods on the Generator, this way is smaller and
more natural to write and read.
Remove format dependency on Generator.