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

Use `safe_load`, rather than `load`, so that we're not vulnerable to code exploits.