Added threadpool

As discussed. If this works it was less of an issue git-wise than I expected.