Thread pool

Initial commit of thread pool implementation