If we are rewriting things, we also need to know which things do not need rewrite because they are not used to begin with.
- Command definitions that are inaccessible or hidden
- Scripts that are not referenced by other scripts or command definitions
- Modules that are not imported by any scripts
- Module functions that are not used anywhere
In this order I think.