Add repair_shard tests; fix bug

Next up: integration testing.
Header fixes
Add modification tests
Add tests for SELECT queries
Add utility tests