Added an option to output to an arbitrary filelike object.

This was suggested by user badboybeyer on Reddit.