The modules PR includes the syntax to specify that certain commands should only be included if certain modules or libraries are loaded. This syntax is being added speculatively, becuase we do not yet have the ability to query the list of loaded modules or libraries. Once that functionality is present in drgn, we need to retool the logic of the modules PR to properly decide which commands to include. This should not be especially difficult; simply changing the logic in register_commands should suffice.
We can also clean up some small changes that were made to prevent crashes due to non-present types.