Remove `@mut Resolver`

Instead use &mut everywhere as much as possible and then reorganize lots of code
to get past the borrow checker.