refs #209
Two things:
- Use an IndexScanCursor to abstract scanning an index.
The key bounds vary based on index ordering and cursor direction.
Build the BasicCursor by deriving from IndexScanCursor instead of
delegating to an IndexCursor directly.
- When a reverse cursor prelocks keys, swap start/end key so that
we maintain the invariant that all left keys are <= right keys.
This is important because a reverse cursor will have something like
{ start: 10, end: 5 } which is valid since it's iterating backwards,
but we need to prelock { left: 5, right: 10 }