Implement `map_mut` on the Option type

Closes #7394
remove some method resolve workarounds
auto merge of #7497 : alexcrichton/rust/issue-7394, r=huonw
Merge pull request #7595 from thestinger/iterator

remove some method resolve workarounds
Revert "De-share ast::Ty"

This reverts commit 47eca2113c5c55a4ffbb8c11a38c8ca7a79a1d72.
De-managed ast::Path
Add trait-based AST visitor
Rewrite two of the visitors

Rewrites two of the visitors, the id_visitor and the ast_map visitor.
I also re-wrote the AST map to use borrowed pointers into the AST,
which means that it makes no copies of AST items.

This only changes libsyntax.
Work-In-Progress Commit

Fixes almost all the resolve errors from the libsyntax changes.
Requires a new snapshot, temporarily using aborted snapshot to
work on this.

Change entry-point finder to use new visitor
Add lifetime annotations everywhere needed
Changes the AST map builder to use a callback

This is for 2 reasons, 1. The map gets updated by the metadata
reader and any other way would require moving it out of the
owning structure. 2. Issue #4868 means that a borrow of the Map and
its lifetime collide, forcing the borrow to last for the lifetime of
the Map itself, not ideal.

There is some unsafe code introduced here to work around this problem
as it still comes up, but in a more managable form.
Work In Progress

Fixes a variety of lifetime errors in various places