Timeout and autoexpand support

I added support for killing worker processes after a timeout and for autoexpanding the queue, with a cap on the number of workers if desired.