Fix job dependency bug

Jobs dependent upon multiple other jobs may start prematurely, after
only some of the depdendencies are satisfied.
bug 746
Make depdenency parsing logic more robust