Tests passing, replicator and pouchService refactored