Refactor string functions, fix many defects.

Add a date for when it was deprecated.