Rename metadata::tags to metadata::common. Move some utility functions from metadata::encoder to metadata::common.