changed to use TBMQueue, added ability to specify the number of worker threads.