Add a simple method for marshaling to json.

This adds a simple json dumper to the generated files.
Add MarshalJSON forwarder
Don't import JSON imports when file has no JSON writing types.
Handle TEXT_DATA and lists.

This changes the codegen so that every field get its own block with a redeclaration. Keeps the code handling names and values separate.