Fixed importing files with CRLF or CR line endings

Also added final LF to exported file. This is the convention.
Merge pull request #210 from nathan/import-newlines

Fixed importing files with CRLF or CR line endings