Remove dead entries in .ninja_log and .ninja_deps while recompacting.

For .ninja_deps, remove objects that have no in-edges or whose in-edges
do not have a "deps" attribute. (This matches the behaviour of `-t
deps`).

BuildLog doesn't know about state, so let its recompact method take
delegate that decides is a path is life or not, and implement it in
NinjaMain.
Make tests compile (one fails atm).
Fix DepsLogTest.Recompact by making sure outputs aren't garbag-collected.
Add a test for collection of dead deps entries.
Add a test for collection of dead log entries.
Move duplicated code into a helper function.
Rename "IsDead" to "BuildLogUser".
Add a comment.
More robust escaping of $in, $out paths

In summary: don’t escape if the path doesn’t contain problematic characters, otherwise:
- Shell: enclose string in single quotes, escape embedded single quotes with the magic quote-backslash-quote sequence
- Win32: Escape double quotes by doubling the number of consecutive backslashes that precede them (if any) and adding one more. Finally, double the number of trailing backslashes, and enclose the whole thing in double quotes.
Merge pull request #690 from nickhutchinson/feature/escape-paths-properly

More robust escaping of $in, $out paths
Make BuildLogUser reference constant.
Merge pull request #697 from nico/gclogs

Remove old outputs from build log and deps log during recompaction.
Don’t unnecessarily escape backslashes in Win32 paths

Under ::CommandLineToArgvW() rules, the backslash character only gets special treatment if it’s immediately followed by a double quote. So, when checking to see if a string needs Win32 escaping, it’s sufficient to check for the presence of a double quote character. This allows paths like "foo\bar" to be recognised as “sensible” paths, which don’t require the full escaping.
configure.py: use /FS flag under vs2013 when compiling gtest
Merge pull request #701 from nickhutchinson/feature/msvc-gtest-cflags

configure.py: use /FS flag under vs2013 when compiling gtest
Merge pull request #702 from nickhutchinson/feature/win32-escaping-fix

Don’t unnecessarily escape backslashes in Win32 paths
emacs: ELPA compatibility
emacs: Fix a warning

Fix a following byte-compile warning:
ninja-mode.el:18:7:Warning: assignment to free variable `ninja-keywords'
emacs: Place provide form at end of file

Any errors in the code after "provide" will leave the feature
registered, so it should always be at the end.
Merge pull request #705 from yasuyk/elpa

emacs: ELPA compatibility