Added to_string functions and tests.