Refactor job suspend/resume logic

For improved support of job arrays