codegen: mangle the 'Undefined' enum/union constructor
codegen: emit init_root and to_message functions
topsort: fix duplicated references in reference graph