Implemented support for RepositoryFactory.

This allows anyone to override the default behavior to load Repositories.