Don't skip trees with transparent positions when looking for references

Trees with a transparent position may contain trees with range
positions, hence we should make sure to:

1) Traverse tree with a transparent position, and
2) Only call `report` on tree that have an opaque range position.

This is a bug that was made apparent by the changes needed to fix the
Scala compiler ticket SI-4287.
Using the enclosed type to fix completion and imports for inner classes.

Make sure that the enclosing object is passed to the indexer also for modules.

Fix #1002002