Cleanup method dispatch

This is a complete rewrite of method dispatch, though it uses a lot of the code copy-and-pasted and rearranged. The goal is to fix some cases where the current rules were failing to resolve (e.g., https://github.com/rust-lang/rust/issues/18674) as well as be more amenable to caching and optimizations like the fast-reject proposal.