Clean up Buildable instances to rely on BuildRuleParams a little less.

Summary:
When we transitioned from BuildRules to Buildables we simply changed the inheritance hierarchy
and then fixed the compilation errors. This isn't ideal, since we left references to
BuildRuleParams in many constructors. This diff clears up most of those references and deletes
the newly unusued code.

Test Plan: buck test --all
Extract buildTarget field in AbstractBuildable implementations.

Summary: buildTarget is a common field in many AbstractBuildable subclasses. This Extracts the field to an AbstractBuildTargetBuildable common superclass. Fixes T3610259.

Test Plan: buck test buck --all
Ensure buck, and its tests, pass cleanly on Java 8.

Summary:
Looks like Java 8 rejigs the way that Sets are ordered by default. Get our tests green again,
but I suspect we need to audit where we add lists to rule keys and ensure that they're always
sorted.

When Buck is compiled using Ant, the source and target versions of Java are not specified, so
whatever is being used by the system is selected. Android, OTOH, popularly targets Java 6,
so we need to ensure that the correct versions are being tested in the `DalvikStatsToolTest`.

Test Plan: buck test --all on Java 7 and 8
Introduce the concept of a target graph.

Summary:
TargetNode is pretty much a copy pasta of DescribedRuleBuilder's constructor,
except it skips parsing the visibility patterns since it's not needed until you
actually build a rule. TargetNode encapsulates a parsed build rule's raw inputs,
its description, input paths and build targets referenced. Once we have the target
graph, we traverse over it bottom up, building up the action graph using the
TargetNodeToBuildRuleTransformer.

Test Plan:
buck build instagram
Used visualvm to record memory usage during the parsing step, did not notice any
significant impact. Ditto with time to finish parsing for fb4a.
Support targets of the form 'android-#' for android_binary

Summary:
Modified the regex in AndroidPlatformTarget.getTargetForId() to work for
strings of the form 'android-#'. Closes #118

Test Plan:
Run `buck build hello` and verify that the build succeeds. Then replace 'Google
Inc.:Google APIs:16' with 'android-16' in fbandroid/apps/samples/hello/BUCK,
run `buck build hello`, and verify that the build succeeds.
Revert incorrect support for 'android-#' targets

Summary: This reverts commit 509f94a65e2123447c337730d54775702285d8f0.

Test Plan: revert-hammer

Reviewed By: natthu

Subscribers:

Tasks: 4391518
Kill RecordArtifactsInDirectoryStep.

Summary: Replace it with a copystep and buildableContext.recordArtifactsInDirectory().

Test Plan:
buck test --all
sandcastle
Pass system environment `PATH` in the NGContext for DaemonIntegrationTest.

Summary:
I turned on the test locally (because I think we solved the watchman issue now)
but the test still failed - although this time for a different reason. This
particular test case calls 'buck targets' which was failing essentially due to
some failure in executing buck.py. I printed the command to execute buck.py and
noticed that the interpreter used was jython (and not python2). Turns out since
the "PATH" property is not set in the test NGContext, `BuckConfig` cannot find
the system python/python2 files and so uses the fallback jython interpreter.

We should probably figure out why the jython invocation fails.

FWIW, this is the python trace for the jython failure:
```
Traceback (most recent call last):
  File "/tmp/buck8197345396108643146.py", line 1049, in <module>
  main()
  File "/tmp/buck8197345396108643146.py", line 1049, in <module>
  main()
  File "/tmp/buck8197345396108643146.py", line 468, in main
  buildFileProcessor.process(build_file)
  File "/tmp/buck8197345396108643146.py", line 399, in process
  execfile(os.path.join(self.project_root, build_file),
  File "/home/natthu/devtools/buck/src/com/facebook/buck/httpserver/BUCK", line 1, in <module>
  java_library(
  File "/tmp/buck8197345396108643146.py", line 80, in invoke
  return self.func(*args, **updated_kwargs)
  File "/tmp/buck8197345396108643146.py", line 298, in glob
  paths = [p for p in paths if not exclusion(p)]
  File "/tmp/buck8197345396108643146.py", line 296, in exclusion
  return next(exclusions, None)
  NameError: global name 'next' is not defined
```

Test Plan: DaemonIntegrationTest passes (after removing the Ignore annotation).
Re-enable integration tests that were disabled because of the inotify limit issue.

Test Plan: sandcastle
Fixed printing tabbed stack lines with a color code

Summary:
For some reason, printing a leading tab with a prefixed color code
outputs 4 spaces instead of 8, so this diff just moves the color code to be
after the leading tabs, if any.  Also removed dupey Ansi class code.

Test Plan:
- In buck repo, run this failing test: buck test test/com/facebook/buck/util
- Verify all the stack lines are aligned, and the ones from the test are
  colored.
Pass client environment to AdbHelper.

Summary:
Previously AdbHelper would always use the process
environment whether or not buckd was used. This change ensures that
AdbHelper always uses the client environment.

Test Plan: buck test --all
Allow the manifest of a java_binary to be the output of another target.

Summary:
It can be useful to programatically generate the manifest file for a java_binary. Make it easy
to do that :)

Test Plan: buck test --all
Revert "Re-enable integration tests that were disabled because of the inotify limit issue".

Summary: This reverts commit 5955f66123b19c713afef887675a9742d105c989.

Test Plan: revert-hammer