Moved internal commands into controlJobs, moved file redirection into separate functions, made internal command redirectable