Better string generation

Avoid backslashes if possible, this makes the output more readable.

Eg: `'foo"bar'` instead of `"foo\"bar"`

Also make sure that unsupported ruby objects are serialized as a string
to avoid parsing issues.