thpool: make time-related functions configurable

first reason is to make testing easier
thpool: add helper methods to WorkQueue

most client code doesn't care about the `tag', as long as is
unique. So move the generation insife the WorkQueue class.

implement __len__, first reason is for test purposes.
thpool: bootstrap the testsuite

Initial round of tests for
* schedqueue.SchedQueue
* watchedpool.WorkQueue