repository: Refactor `ReplicateRepository` RPC
Currently there is significant duplication of test setup for the various
different ReplicateRepository
RPC tests. This change refactors some of
these tests into a single table driven test.
Also currently the repository replication logic occurs directly in the
ReplicateRepository
function invoked by the RPC. In the future
repository replication will also need to be used by object pools so in
this change it is factored out.