code: function demodule(t) {
      t.modules.forEach(function(name,ref) {
          var module = resolveToObject(ref)
          if (t.properties.has(name)) {
              var typ = t.properties.get(name).type
              if (isOnlyFunction(typ)) {
                  typ.calls.forEach(function(call) {
                      module.calls.push(call)
                  })
              } else {
                 throw new TypeError(t.qname + "." + name + " of type " + t.properties.get(name).type + " clashes with name of ref"); 
              }
          }
          if (!module.origin)
              throw new Error("No origin on module: " + module.qname)
          t.properties.put(name, {
              optional: false, 
              type: ref,
              meta: {
                  origin: module.origin
              }
          })
          demodule(module)
      })
  }
docs: --------------------------------------------------- Demodule phase: Convert modules to properties ---------------------------------------------------