Extended newline replacement to handle Windows-style CRLF newlines

Data from external sources (files, web services) often contain windows-style CRLF newlines that are not valid in Xcode. When only replacing '\n' with escaped newlines, a CR ('\r') character will remain and make the file invalid.
This pull request fixes this issue by extending the replacement regex to also match '\r\n' (CRLF) newlines. It also includes a unit test for this issue.