This takes an opcode logical definition, and builds both the
datatype and the JSON serialisation out of it. We can't use a
generic serialisation since we need to be compatible with Ganeti's
own, so we have a few quirks to work around.

This takes a Luxi operation definition and builds both the
datatype and the function transforming the arguments to JSON.
We can't use anything less generic, because the way different
operations are serialized differs on both parameter- and top-level.

This function builds two different data structures: a filled one,
in which all fields are required, and a partial one, in which all
fields are optional. Due to the current record syntax issues, the
fields need to be named differrently for the two structures, so the
partial ones get a P suffix.