Added support for writing to a file

Using tabs instead of a mix of tabs and 4-spaces.
Added -o to be able to write to an outputfile.
Using exit() instead of quit() together with print.