Add wrapper types to encode conversion target value types and to_json overloads to perform the conversions. Fixes #3425.