make metadata indexing consistent

previously I had thought it would be more useful for indices of metadata
instances with one field to return a scalar. In practise, it's annoying that the
behaviour is different from metadata with multiple fields, which returns a
dictionary. this commit makes the return value always a dictionary, even when
there is only one key-value pair. tests updated.