Ported replication to pydriver