Adapt similar loaded module detection code and add tests to check
behavior when the target of a virtual module is loaded as is and a
virtual module targeting it is loaded/unloaded/switched/etc.
Also set test cases on module mixing regular and virtual versions,
playing with short or full path name representation.