split out dirty recomputation logic from Edge class

Rather than passing States and DiskInterfaces through all the calls,
put the necessary ambient information in a new DependencyScan object
and move the code accordingly.

Note: I didn't move the source location of the functions to preserve
history, though this does result in a sort of weird order for the
functions in graph.cc.
remove a redundant arg to RecomputeOutputDirty
remove config from BuildLog, rename members
pass Builder as arg to build-running functions

Reducing use of globals.
fix --debug for glibc pedantic mode
move BuildLog to DependencyScan

The build log is needed in computing whether an edge is
dirty, so I think it belongs here.  (It's a bit weird
that Builder needs to reach into it to record completed
commands, maybe it will become cleaner with more thought.)
clarify setter
remove unfortunate header dependency

This was temporarily added, and now it can be removed.
remove DiskInterface from globals
move BuildConfig out of globals
reduce indent
show all in graph
rearrange tool-picking logic

Now "ninja -t list" works from any directory.
factor out build log load from main
factor out metrics dump from ninja main
allow tools to specify when they run (before/after build.ninja load)

This will be necessary to inline msvc-helper as well as so -t graph
can get depfiles.
Merge pull request #408 from nico/fix

Make sure no stale test file exists before running build log tests.
drop special case for msvc bucket count

Calling bucket_count() works locally with MSVC.  I wonder if some
other change in the code fixed this.
add GetProcessorCount() implementation for Solaris
disable a new warning that popped up on Windows

This pattern is safe as long as you're careful; we don't use it
very much.