Added shared super class for all Repositories.

Added tests and new methods for Metadata repository.
added more methods and tests to domain module
more migration fo core module