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

If I'm not mistaking, `dict` does not persist order of it's elements, so it's just a coincidence that it generated this particular text representation. So, this test might be very fragile. I would test that serialize-deserialize results in same object.