initial job chaining support

I added initial support for chaining jobs, it is not optimized yet (map of jobs is still being generated each time) but seems to do the job. Please review and get back to me if you require any changes.