Added the ability to redirect output to a file. Works with commands
passed.