Rewrite threading

Use Python Queues, spawn worker threads which get items from the queue