Use templating for repair shard tests

Needed because of the port number.
Header fixes
Add modification tests
Add tests for SELECT queries
Add utility tests