Move C++ helper code to libcxxgen and dwarfidl. Minor cleanups.