[GH #958] Add tests for chomp from osutils.
[GH #958] Fix chomp to only remove a newline when it ends the string.