Refactor of cursor test for replica sets