Adding a thread pool class.

I usually try not to add new code that is not used, but I'm making an exception here, because I want as much time as possible spent reviewing this class.