Also uses the class refname where appropriate since an instances refname
reflects the alias currently in use and if a module is reloaded while
using an alias the old behavior would generate spurious cache entries
that would not be cleaned up or modified. Specifically, this could
register a self-referential alias that would cause a stack overflow when
trying to `use` such an alias.
Additionally, some other `fullname`s were changed to `realname`s for
clarity.
This allows modules that can be addressed by name to register possible
aliases for themselves by defining an `Aliases` constant in the top
level of the module.