Revised threading system to use Java ExecutorService thing.