Fix line-wise put before on an empty buffer

- Avoid special case in common 'Put' with trailing line break
- Handle special case for put after in 'PutAfterCaretCore'
- Add related CommandUtil and CommonOperations unit tests

Closes #1304
Repair conditions under which StringData is adjusted
Merge pull request #1305 from ricksladkey/fixes-put-empty

Fix line-wise put before on an empty buffer