Metadata cleanup

Here are some more radical changes to the utilities and metadata handling...