Better handing for redirects in MockRepositors

Also adds more tests.

Change-Id: I9ac1493f3b57962fa12ecb6483c9081eeddea637