Threadpool

Part of #4 issue.