New method for getting the count of a table, including optional WHERE clause
Factor out an abstract test case for common code, add test for the count feature, some minor cleanup