some mini fixed on open files
added a wait if reached maximum number of jobs in queue
refactored a few things around the maximum jobs in queue feature
add condition to break waiting if number of unfinished jobs reached
Merge pull request #1 from karlnapf/max_queue

Max queue