Cleaned up the cursor struct and renamed some funcs.
Unfortunately performance is 2x slower than before. Need to figure out what happened.