Added a pool to manage job queues. Fixed a few bugs with job queues.