Make sure we write all our files in binary mode.

- Supports transactions.
- Includes tests.
- Closes #205