Change metadata to case-insensitive OrderedDict

Here "case-insensitive" means that keys are converted to uppercase internally.