(#1916) - clean up db.replicate.foo and break sync out into its own module