Cleanup some trailing spaces.
Support passing a readable stream as file instead of a filename.
Make sure that any errors from fs.writeFile are emitted to the stream instead of silenced.
Cleanup more trailing spaces.
Add tests for the writable streams behaviour.