Test case to show the presence of the text vs binary bug.

For #205.
Make sure we write all our files in binary mode.

- Supports transactions.
- Includes tests.
- Closes #205
Merge pull request #206 from pjf/205_text_vs_binary

Always write files in binary mode.