addrs: Factor out MoveEndpointInModule module prefix matching
addrs: Factor out MoveEndpointInModule module prefix matching

All of our MoveDestination methods have the common problem of deciding
whether the receiver is even potentially in the scope of a particular
MoveEndpointInModule, which requires that the receiver belong to an
instance of the module where the move statement was found.

Previously we had this logic inline in all three cases, but now we'll
factor it out into a shared helper function.

At first it seemed like there ought to be more factoring possible for
the AbsResource vs. AbsResourceInstance implementations, since textually
they look very similar, but in practice they only look similar because
those two types have a lot of method names in common, but the Go compiler
sees them as completely distinct and thus we must write the same logic
out twice. I did try some further refactoring to address that but it
made the resulting code significantly more complicated and, by my
judgement, harder to follow. Consequently I decided that a little
duplication was okay and warranted here because this logic is already
quite fiddly to read through and isn't likely to change significantly once
released (due to backward-compatibility promises).

tommynsong/terraform,hashicorp/terraform,ewbankkit/terraform,ewbankkit/terraform,ewbankkit/terraform,rnaveiras/terraform,hashicorp/terraform,tommynsong/terraform,rnaveiras/terraform,rnaveiras/terraform,hashicorp/terraform,ewbankkit/terraform,tommynsong/terraform