[SPARK-3713][SQL] Uses JSON to serialize DataType objects

This PR uses JSON instead of `toString` to serialize `DataType`s. The latter is not only hard to parse but also flaky in many cases.

Since we already write schema information to Parquet metadata in the old style, we have to reserve the old `DataType` parser and ensure downward compatibility. The old parser is now renamed to `CaseClassStringParser` and moved into `object DataType`.

@JoshRosen @davis Please help review PySpark related changes, thanks!
I'd like this one:
```
{self.simpleString: {'type': self.elementType.jsonValue(),
                               'containsNull': self.containsNull}}}
```
it will be better if it has one layer:
```
{'type': self.simpleString, 
 'type': self.elementType.jsonValue(), 
 'containsNull': self.containsNull}
```

I prefer fewer lines personally, then I can read more codes in one screen.