Modularized tests

Refactored the tests to make it easier to run them with different
types of tables (such as TBB).