Make newline detection platform independent

This change makes the `\r` optional in a line break. When using the library on OS X, it wasn't detecting newlines properly. My files were separating lines with `\n`, rather than `\r\n`. I believe that the latter is Windows specific.