db.select() has become db._select()
This commit refactors database._tables so that they can work properly
after a proxy or filter has been removed.
It adds abstract API called QuerySet which allows a variety of
selections and ordering of data.
Logging was added to sqlite to better see db access.
Additional fixes:
* clearing GenericDB._directory
* test_util_test off-by-one error