Move string to type conversions into a common file.