In order to access entity data from foreign repositories Repo becomes in a way a Client to foreign repos.
Technically accessing foreign entity data would happen using services introduced in the Client component (T148141).
In order to reuse code we decided to make Repo optionally use the service factory from the Client component. If the service factory is provided Repo would use services from the factory instead of instantiating its own services.
This changes introduces optional Repo dependency on Client. This is not the cleanest structure and it is only intended as the first step to make Wikibase able to use data from foreign repositories.
In the long run the Repo/Client (and Lib) division should be thought again. As we now consider Repo to be Client in a way, the whole distinction between Repo and Client seems not clear and very arbitrary.
Patches for review: