SI-8015 Refactor per code review

Make an obscure private def local and rename it usefully.

If you really must have similar functions in the API
(to detect line breaks and EOL), at least make them DRY.