Fix testing bins with lib deps

If a package had both bin and lib deps, `cargo test` was not building the `lib`
dependency when building the bins with `--test`. This commit adds an extra
"test" profile (not compiled with --test) for situations such as this which is
filtered out normally but kept around for the `cargo test` case.
Fix --release not compiling upstream deps with -O3

This touches up the filtering logic to ensure that upstream dependencies as well
as local dependencies are built with optimizations when `cargo build --release`
is used.
Disable passing -g for now
Resolve more correctly and add --extern

This commit adds support for passing --extern to dependencies. It allows
multiple copies of the same named dependency in the system, as long as
they come from different repos.
Fixed a number of bugs related to rustc building

Most notably, `resolve` now takes the root, so it can properly link the
root package with its dependencies (which is required to build the
--externs for the root package).
Add some unit tests
Remove hardcoding
ToStr::to_str -> ToString::to_string

Conflicts:
	src/cargo/core/resolver.rs
	src/cargo/ops/cargo_rustc.rs
Make README nightlies links clickable
More updates to master
Add -u to `cargo test`
impl Show for Profile
No need for a TempDir, use `-` as input
Fix filtering for test deps

This fixes `cargo test` to only test the *local* package
Tighten up some tests
auto merge of #157 : rust-lang/cargo/graph-resolve, r=alexcrichton

This incorporates previous bugfixes by @alexcrichton that are still stuck in bors.