Refactor PreparedStatements such that they're prepared once.

Also fix minor bug in system table, those unit tests pass now.
TableKeyValueStoreDatabase tests work for C*.