Fix file handle/line ending issues so that tests pass on Windows
Merge pull request #1066 from melissalinkert/rebased/dev_5_0/windows-tests

Fix file handle/line ending issues so that tests pass on Windows (rebased onto dev_5_0)