Use io.open so it works on Python 2 too.
Merge pull request #1 from ionelmc/rewrite-windows-fixes

Windows fixes and whatnot