Avoid duplicate modules

The meat of this change is that we now prefer the identifier declared by `@providesModule`, if any, to the original identifier that was to be resolved.

Relative identifiers required by a module that contains a `@providesModule` directive will be evaluated relative to the provided identifier.