Added first attempt at SQL query tracking/checking for tests.