Add method cleanup_children for removing dead child threads.
Add parameter 'direct' to map function to be able to either run new threads which
directly get a slice of work items or queue slices of work items in the job queue.
In _submit method ensure to create new child thread if all active child threads are busy.