Add low-level line ending conversion functions with its test file
They will be put in use in next changesets.