scm: add merge-base and origin url properties to git

catch exceptions and always remove remote in `mkremote`

Testing Done:
build passes: https://travis-ci.org/cheecheeo/pants/builds/31666560

This is necessary for a feature that will include the merge-base and repository url in pants-built artifacts.

Reviewed at https://rbcommons.com/s/twitter/r/834/
Simplify phase.py.

- Gets rid of clever but complicated deduping logic. Replaces it with
  dumb but simple deduping logic via a factory.

- Gets rid of a few methods that were either entirely unused or only used
  once (in which case replaced them with alternative code).

- Phases now store task names and types directly. The TaskRegistrar instance
  isn't retained after registration.

- A Phase now directly knows its depenendcies on other phases, instead of
  delegating to the union of dependencies of its TaskRegistrars.
  This makes a lot of code much simpler.

- Phase no longers uses the old 'goal' terminology.

- Move logic such as option parser setup from TaskRegistrar into Phase.

This simplifies Phase itself and a lot of code that uses it, and
paves the way for renaming Phase to Goal.

Testing Done:
CI passed: https://travis-ci.org/pantsbuild/pants/builds/32051833.

Unit and integration tests pass locally too.

Ran some manual builds, including "./pants goal goals --goals-graph".

Reviewed at https://rbcommons.com/s/twitter/r/856/
Moved some example code out from /src and /tests into /examples/src and examples/test

We discussed a new layout for example and testproject code on the list:

https://groups.google.com/forum/#!topic/pants-devel/cLsY7ksLoyM

This patch covers moving the java examples.  If we like this, I'll continue on with non-java targets and
testprojects into a new /testprojects/ top level directory.

Testing Done:
Updated tests, ran tests. CI is baking.

Bugs closed: 472

Reviewed at https://rbcommons.com/s/twitter/r/868/
git: commit date of refs

Testing Done:
ci.sh succeeds

Reviewed at https://rbcommons.com/s/twitter/r/871/
Fixup missed parameter rename.

https://rbcommons.com/s/twitter/r/871/ comitted @ 50bdab06 failed CI here: https://travis-ci.org/pantsbuild/pants/jobs/32402628
This fixes that.

Testing Done:
$ PANTS_DEV=1 ./pants goal test tests/python/pants_test/scm/::
...
23:16:08 00:00   [test]
23:16:08 00:00     [pytest]
23:16:08 00:00       [run]
                     ============== test session starts ===============
                     platform linux2 -- Python 2.6.9 -- py-1.4.23 -- pytest-2.6.1
                     plugins: cov, timeout
                     collected 4 items

                     tests/python/pants_test/scm/test_git.py ....

                     ============ 4 passed in 0.60 seconds ============

23:16:28 00:20     [junit]
23:16:28 00:20     [specs]
               SUCCESS

Bugs closed: 476

Reviewed at https://rbcommons.com/s/twitter/r/875/
Fix the builddict and add a basic ci test.

This wires up a run of build-support/bin/publish_docs.sh as part
of the ci suite to at least confirm it runs without raising.

Testing Done:
Now works:
==
./build-support/bin/publish_docs.sh

Travis CI went green here: https://travis-ci.org/pantsbuild/pants/builds/32401953

Bugs closed: 475

Reviewed at https://rbcommons.com/s/twitter/r/873/
Deploy pants with py27 only
Always use BuildFile.from_cache and squash annoying warning
Add python as default codegen product
Patch JvmRun to accept JvmApps

Conflicts:
	src/python/pants/backend/jvm/tasks/jvm_run.py