Using os.EOL instead of \n in generated output

Tests now pass on Windows.