Adding field to_string/from_string methods that encode to JSON/YAML strings.

`field_name` is not defined here and it's not passed to this function from where it's called. Most likely a copy-paste error