Add ClassDef name to XML.

Mistakenly removed a while ago.
Add JSON AST serialization.