Generator support for unique IDs for each field

Added support to the code generator to emit a unique ID for each field
in a generated class. Doesn't check base class for collisions, only the
class that is being generated.