Implemented signal handling. Works, but does not handle interrupts well when there is no foreground job.