Actually fix the Router#replace() issue in all browsers, including IE

This also makes the test more robust too.