Add countable interface and isEmpty method to MetadataBag, fixes #367