Make metadata parsing optional.
(Also changes to cope with a bit more variability in header layout/format).