Rework the Resolver as an AST mutator.

As it turns out, this is a lot more pleasant to work with.
Don't overwrite previous resolution results.