Added string functions from T2D

This is necessary to share some of T2D's unit tests for #626.