Covered MetadataRepo class by specs. Moved most of functionality from Repo to MetadataRepo class.