ensure outputs are always written in binary mode
Merge pull request #3 from wchristian/binary_outputs

ensure outputs are always written in binary mode