Add TestMVCC

Lots of cleanup.
Add query plan test to sql driver.
Ensure that all query plans avoid table scans.