Replace `context.isPresent()` with `isDaemon`, as appropriate.

Summary: This will make a follow-up diff cleaner.

Test Plan: Sandcastle build.
Update `BuckEventListener.outputTrace()` to take a build id.

Summary:
This ensures that all listeners can output their own trace
with a common identifier.

Test Plan: Sandcastle builds.
Introduce `TimeSpan` class.

Summary: This makes it possible to group a duration and a `TimeUnit` in one object.

Test Plan: Unit test.
Change BinaryBuildRule.getExecutableCommand to return List of arguments instead of formatted string.

Summary: Change getExecutableCommand to return something easier for ProcessBuilder to work with.

Test Plan: buck test --all
Avoid fetching artifacts for a rule if any of its dep had a miss.

Summary:
This is desirable since a cassandra cache takes a non-trivial amount of time.
Delete remaining buck query related class.

Summary: deadcode

Test Plan: sandcastle
Allow a SourcePath to modify a DescribedRule's deps.

Summary:
A SourcePath that points to a target is implicitly a dependency of a rule.
This change examines the populated constructor arg and adds any
BuildTargetSourcePath entries as dependencies.

Test Plan: buck test --all
Allow a constructor arg parameter in a Description to be declared as a wildcarded Optional.

Summary:
This change allows users to declare fields of type "Optional<? extends SomeClass>"
and not have the ParamInfo choke on it. This makes writing tests against these
parameters a little less verbose.

This diff also reduces duplication in ParamInfo.

Test Plan: buck test --all
Allow the src attribute of an export_file to be another build target.

Summary: Allows the output of a build rule to be exported under a different name.

Test Plan: buck test --all
Introduce Closure Templates.

Summary:
I decided that I should not write any more Java code that generates
HTML, as using a template language makes a lot more sense.
(We should also consider rewriting the Python code for `buck project`
in Java now that we can template XML with Closure Templates, too.)

I spent hours today trying to serve JSPs from embedded Jetty, but was
unsuccessful. The docs here are incomplete:
https://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

I also tried building Mustache (https://github.com/spullara/mustache.java),
but that pulled in code for Scala and JRuby, so that seemed like it
would result in adding a bunch of stuff that has no business being on
Buck's classpath. Apache's Veclocity was a similar situation.
This pulls in a version of Closure Templates with its
Guava and Java annotation classes stripped out of it so
they do not conflict with the ones we already have on
our classpath.

This will be used for upcoming work on the buckd HTTP server.

Test Plan: Manual testing in follow-up diff.
Refactor a reusable sorting method out of DirArtifactCache.

Test Plan: Sandcastle builds.
Add static files for the embedded Chrome Trace viewer.

Summary:
These resources were generated from https://code.google.com/p/trace-viewer/
using the following bug fix: https://code.google.com/p/trace-viewer/issues/detail?id=478.

Test Plan:
Used with an upcoming diff that serves traces via Jetty.
Introducing these files in their own diff so the subsequent diff is easier to review.
Serve build traces via HTTP when running buckd.

Summary:
`buckd` is already running a web server for the experimental Buck IntelliJ plugin.

This piggybacks off of that work by adding a few servlets to that web server needed
to serve Chrome traces:

* A `ResourceHandler` to serve the static `trace_viewer.css` and `trace_viewer.js` files
 that contain the UI for the embedded Chrome Trace viewer. These resources were
 generated from https://code.google.com/p/trace-viewer/ using the following bug fix:
 https://code.google.com/p/trace-viewer/issues/detail?id=478.
* A `TraceDataHandler` that acts as a JSONP endpoint to serve data from the user's
 `buck-out/log/traces/` directory. It handles URLs of the form
 `http://localhost:9011/tracedata/2cS9z5Ie?callback=onTraceLoaded`,
 wrapping the JSON from `buck-out/log/traces/build.2cS9z5Ie.trace` in
 a call to `onTraceLoaded()` (as you would expect from a JSONP endpoint).
* A `TraceHandler` that loads the Chrome Trace viewer with data by generating an
 HTML page with `<script>` tags that load data from the other two handlers.

Now, if `buckd` is running and a port has been specified in `.buckconfig`, a URL like the
following will be printed to the console: `http://localhost:9011/trace/{id}`. Opening this
link in Google Chrome will display the trace for the build that just finished.

Test Plan:
Add the following to `.buckconfig.local`:

```
[httpserver]
    port = 9011
```

Then run `buckd && buck --version` to ensure `buckd` is up and running.

Then visit `http://localhost:9011/trace/{id}` where `{id}` is the
id of a trace in your `buck-out/log/traces` directory.
Fix Eclipse warnings under src/.

Test Plan: src/ directory in Eclipse is warning free.
Rebuild BuildFileTree once per build.

Summary:
Constructing a BuildFileTree is an expensive operation on
Linux. When switching branches many BUCK files are added and deleted,
causing many identical BuildFileTrees to be constructed for each BUCK
file. This change ensures that BuildFileTrees are only constructed
once per build to avoid this overhead.

Test Plan: buck test --all
Add unit test for `DirtyPrintStreamDecorator`.

Summary:
This fixes `DirtyPrintStreamDecorator` so that:
(1) It uses delegation instead of inheritance.
(2) For methods that return a `PrintStream`, it returns the
    `DirtyPrintStreamDecorator` instead of the delegate.

Test Plan: DirtyPrintStreamDecoratorTest.
Add more cases to EscaperTest.

Summary:
There was a lot of untested code in Escape.java: now it's tested.
No issues were discoverd.

Test Plan: EscaperTest
Add more test coverage for MutableDirectedGraph.

Test Plan: MutableDirectedGraphTest
Remove some unused methods from DefaultImmutableDirectedAcyclicGraph.

Test Plan: Sandcastle builds.
Remove some unused code from BuildRuleFactoryParams.

Test Plan: Sandcastle builds.