Fixed importing files with CRLF or CR line endings

Also added final LF to exported file. This is the convention. Addresses (8) in #208.