data: small fixes to csv mode
data: windows compatibility with csv module

in Py2 wants binary write
in Py3 wants newline=''
Merge pull request #333 from mrocklin/csv-fixes

Csv fixes