lib/string: some cleaning, doc and unit tests