set the arguments parsing and evaluation as a standalone method.
set the output stream configurable.
add optional argument: -o outputfile. If there is no output file
specified, the standard output is used as default.
bugfix: the option variable name is "outputStream" not "resultStream"
more the argument parsing and result parsing into a method from the
main.