Added ability to output to stderr and a file. Added examples of how to do so.