Added SIGINT and SIGTSTP handling, need to put waitpid into a loop because right now, its possible for the foregroundPID to get to an undefined state