Fix exponential expansion of work in method lookup

Fix for #2217. I'm not quite sure I grok the whole setup here (particularly with respect to the prepend work being done), but it fixes the issue nicely and returns method lookup to linear time.

There are module failures in the test suite, but they were introduced in 98fa7a673141c808361f793d6805e8339c54e1b7.