handle control-c and sigterm
re-organize code:

clean up the Job class (move around methods, add comments)

move the logic for translating the Job object into a separate DbJob object

output to the terminal in addition to saving stdout and stderr

separate the code to running the job, save output and return codes, from the code to handle errors