Create a max timeout of 1 minute per test for the Buck build.

Test Plan: Sandcastle builds.
Scaffolding for using the ABI to determine whether a rule needs to be rebuilt.

Summary:
This introduces a new interface, AbiRule, which a BuildRule can implement if
it has the potential to avoid a rebuild due to an unchanged ABI.
An AbstractCachingBuildRule will do some preliminary checks on an AbiRule to
try to avoid a rebuild.

Test Plan: Added a test case to AbstractCachingBuildRuleTest.
Change BuildRule.getOutput()->File to BuildRule.getPathToOutputFile()->String.

Summary:
Also require BuildRule.getOutputKey() to take a ProjectFilesystem.

Testing and distributed builds are easier to implement when relative paths
are used that can be resolved to absolute paths (or File objects) only when either:
(1) The path is being used by a Command that is executed outside of the project root.
(2) Information about the File is needed (whether it exists, its contents, etc.)

Test Plan: Sandcastle builds.
Replace Map<String, BuildRule> with an extensible BuildRuleBuilderParams.

Summary:
Historically, we kept track of build rules as we built them in a
Map<String, BuildRule>. This also doubled as the parameter that was passed to
BuildRuleBuilder.build().

This diff introduces BuildRuleBuilderParams instead of the Map. This is
an important improvement because:

* The raw Map is no longer exposed: it is append-only from the client's perspective.
* We can now add more parameters to BuildRuleBuilder.build() without updating
  all of the call sites.
* In tests, we would frequently create a BuildRule programmatically in one
  statement and then add it to the Map in a second statement. Now this can
  be done in a single statement using BuildRuleBuilderParams.buildAndAddToIndex().

Much of the s/Map<String, BuildRule>/BuildRuleBuilderParams/g was done using
Eclipse for refactoring, so unfortunately, this may have introduced some
long-line violations or other formatting anomalies.

Another thing that magically fell out of this diff was the generification of
BuildRuleFactory and BuildRuleBuilder. Without this,
BuildRuleBuilderParams.buildAndAddToIndex() would return an ordinary BuildRule,
so using it would have required a ton of casting. I didn't seem to get all of
the generics quite right in the case of subclasses, so casting is necessary
for AndroidLibaryRule, RobolectricTestRule, and ApkGenrule. I'm hoping that
someone who is more knowledgeable about generics can help with these three cases
in a follow-up diff.

Test Plan: Sandcastle builds.
Integration test to verify the behavior of how timeouts affect JUnit tests.

Summary:
For a test that uses @Before and threads, specifying a timeout via @Test
is not the same as specifying a timeout via @Rule(Timeout) in JUnit according
to https://github.com/junit-team/junit/issues/686. For now, Buck faithfully
reproduces this behavior of JUnit, though we may want to change this in the
future, as this does not play well with the default timeout in .buckconfig.

Test Plan: Verified that the test passes when run from either Buck or Eclipse.
Print out test results as they become available.

Test Plan:
Ran `buck test --all -v 2` and verified that I could see commands
and test results interspersed.
Ordinary `buck test --all` prints out test results as they become available.
Report the duration of an sh_test.

Summary:
Previously, the duration of an sh_test was hardcoded to be -1ms
and there was a TODO in the code.

Test Plan:
Ran `buck test --all` and saw that
//src/com/facebook/buck/util:one_project_filesystem_test
reported taking more than 100ms.
Rename methods in BuildEvents

Summary:
"started" seems like a very dangerous overload for buildStarted and
buildRuleStarted.  Same with finished.

Test Plan: Built.
Don't ignore build events

Summary:
These sites were constructing build events but not reporting them.
This diff fixes the bug, but it might be a good idea to create a less
confusing API.

Test Plan: nope
Add list of build targets to BuildStarted event

Summary: I'm going to use this in another listener.

Test Plan: Tested in another diff with a listener.
Expand visibility/deps of some build rules.
Fix the build in IJ

Summary:
It seems as if the testrunner now depends on classes from the main buck project in its test suite.
Adding these missing dependencies to the .iml file.

Test Plan:
* Ctl-F9 in IJ without patch. See build fail
* Apply patch
* Ctl-F9. See build pass
Cache build files read by buck targets --json

Summary:
Index cached raw rules by build file, tighten up targets test logic and data
now that all build files are parsed when read, tighten up cache invalidation
logic so that cache is always invalidated on a change to the default includes.

Test Plan:
1) buckd
2) time buck targets --json
3) time buck targets --json
4) check that the time reported in step 3 is significantly lower than in step 2
Strongly type BuildTarget when adding as a dep to a BuildRule.

Summary: Start moving away from just using Strings where Java allows us to be more expressive.

Test Plan: buck test --all
Replace System.err with Console in a number of places.

Summary:
This addresses some TODOs in the code about removing references
to System.err.
This also introduces a subclass of Console, TestConsole, which
should be used in unit tests.

Test Plan: Sandcastle builds.
Remove some unused methods.

Test Plan: Sandcastle builds.
Rename some methods of Console to make their roles clearer.

Summary: Method renaming done via Eclipse.

Test Plan: Sandcastle builds.
Always print test results as they are available unless --verbose 0.

Test Plan:
Ran the following and verified I saw the correct output in both cases:

    buck test --all
    buck test --all -v 0
Renaming BuildRuleBuilderParams to BuildRuleResolver because that what it does.

Summary: Attempt to make the purpose of the params clearer with judicious renaming.

Test Plan:
buck test --all
Admire the aesthetic beauty of a meaningful name :)
Make Verbosity a field of Console.

Summary:
Making Verbosity a field of Console will make it easier to check the
Verbosity when deciding whether to write to the Console.
Because this diff entailed adding a new required parameter to Console's
constructor, rather than add a new param to all of the instances of
"new Console" under test/, I changed them to use TestConsole instead.

Test Plan: Sandcastle builds.