Do not use straight @"\n" in the code

Use the line endings we guess from the first line of the file.
This, really fixes dd for me on CRLF files now.

It also means we support Classic Mac line endings too (CR-ended lines)

Also compute the end-of-line to eat when deleting/yanking at the end
properly.

This should make things better for #530