Add some test cases for cursor
Add cursor tests
WIP: rewriting search procedures with new cursor