fixed bug where last line didn't end in newline preventing last char from being edited - updated tests to deal with forced trailing newlines