Refactored thread pool

Referenced the OpenJDK implementation quite a bit, but without using CAS