Fix leaking trait imports across modules

Turns out the pass in resolve was a little too eager to travel back up the
hierarchy chain when looking for trait candidates.

Closes #10465
rustc: De-indent portions of middle::resolve

It's a little prettier to look at now
std: Fill in all missing imports

Fallout from the previous commits
Fix remaining cases of leaking imports
stdtest: Fix all leaked trait imports
extratest: Fix all leaked trait imports
Fixup the rest of the tests in the compiler
Fix CodeMap issue in expand_include_str()
auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwalton

Turned out to be a 2-line fix, but the compiler fallout was huge.
auto merge of #11401 : michaelwoerister/rust/issue11322, r=alexcrichton

`expand_include_str()` in libsyntax seems to have corrupted the CodeMap by always setting the BytePos of any included files to zero. It now uses `CodeMap::new_filemap()` which should set everything properly. This should fix issue #11322 but I don't want to close it before I have confirmation from the reporters that the problem is indeed fixed.