Refactoring code that sets numberToReturn in OP_QUERY and OP_GETMORE
Added test for killCursors