Adds string escaping in keyvalue serialization