Make metadata code independent of mysql. Make sure metadata repositories get properly decorated.

This is needed to become independent of the repository implementation. The MetaDataService needs to be able to create new repositories to do its administration in. It does not care how and where they are created and indexed.