Make sure no stale test file exists before running build log tests.
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.
deps reload: 'reload' flag - reload dep file and update graph and plan in build time

Dep file is reloaded and dependencies are reevaluated for edges with
rules specifying 'reload=1'. If dirty dependencies are discovered, the
edge is not marked as 'built', and is scheduled for repeated rebuild
after the discovered dependencies are cleaned.

The indended usage is supporting rules generating dependency files.
The proposed usage pattern is:

>>
build auto.o: CC auto.c | auto.d
  cc_options =

build auto.d: DEP auto.c
  cc_options =

rule DEP
  command = gcc -MM -MG $in -MF $out -MT $out $cc_options
  depfile = $out
  reload = 1
<<

Since both .o and .d should have the same dependency list (with the
exception of command line dependencies), we make .o depending on
.d, which __specifies its target as a dep file__, and therefore depends
on all files required to build .o (or to update its dependencies list).

This approach is somewhat similar to have a 'depcommand' attribute in
rules, running before the command is executed to evaluate dependencies.
Here this command runs on a separate edge. This simplifies implementation
and syntax. For instance, it allows giving depcommand its own
'description' w/o adding yet another rule attribute.

Number of such 'rebuilds' is final and limited by number of
dirty targets in the project, if at each iteration a new dependency is
discovered. In the real scenarios, the number of rebuilds is small and optimal:
Each dependencies discovery iteration finds a next level of nesting
of required autogenerated header files, and rebuild is only needed if
these were not generated yet (could be generated already if these
are required by other targets as well).
build_test infrastructure: mkdeps, $content, and DumpCommandsRan()