More refactoring and improvements of job queue / logging.