Fix issue where getShadowTree was not prefixed with scope.

This also fixes issue where inSameTree was broken as well as returning too
early in case retargetting resulted in target and relatedTarget being the same

Fixes issue #71