Separate metadata repositories from MysqlRepositoryCollection

Separate metadata repositories from MysqlRepositoryCollection and hide the mysql implementation behind an interface.