Implemented output option.

Everything that's printed is optionally also printed to a specified
output file