Support option reads via indexing.

This will support tasks with table-driven logic.

Testing Done:
$ pants.dev goal test tests/python/pants_test/option

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

Bugs closed: 846

Reviewed at https://rbcommons.com/s/twitter/r/1435/
Properly detect existence of a symlink.

os.path.exists() returns False for broken symlinks.

Reviewed at https://rbcommons.com/s/twitter/r/1437/
Document how to create a simple plugin

This adds a short tutorial on how to create a simple plugin.

Reviewed at https://rbcommons.com/s/twitter/r/1434/
Better way to avoid unlinking a non-existent file.

This solves a race condition too (although there is still another race),
and is more consistent with similar patterns elsewhere in the file.

Testing Done:
Relevant integration tests pass (after cleaning, so this triggers both a failed unlink and a successful one).

Manually tested the relevant code block.

Reviewed at https://rbcommons.com/s/twitter/r/1438/
Get rid of option_helpers.py.

It was redundant with global_options.py.

This allowed us to make doc gen for global options
more uniform with that for task-specific options.

Testing Done:
CI passed.

Manually generated docs and eyeballed them.

Reviewed at https://rbcommons.com/s/twitter/r/1439/
More intuitive env var names for global-scope options.

Previously for global option --bar-baz you had to set PANTS_DEFAULT_BAR_BAZ.
Now we allow PANTS_BAR_BAZ, eliding the explicit global scope 'DEFAULT'.

If the option name itself already starts with 'pants-', e.g., --pants-workdir,
we also allow PANTS_WORKDIR, instead of PANTS_PANTS_WORKDIR or
PANTS_DEFAULT_PANTS_WORKDIR.

Using env vars to set option values isn't necessarily common, but this will make
it more conveninent and intuitive. Also, it will allow the PANTS_CONFIG_OVERRIDE
mechanism to be retconned into a --config-override option.

Testing Done:
CI passes.

Reviewed at https://rbcommons.com/s/twitter/r/1441/
Eval list- and dict-typed option values, instead of JSON-parsing them.

This is to support list concatenation syntax in config files, e.g.,

dev_opts: %(basic_opts)s + %(big_mem_opts)s + ['-ldebug']

This is a legitimate use case that we actually have, but that I overlooked
when I made the JSON requirement in 8c3b5b33e8cabdf599ed1332067283ffc067a13a.

Testing Done:
Ran options unit tests.

CI baking.

Reviewed at https://rbcommons.com/s/twitter/r/1443/
rename dev_backend_loader to extension_loader

This is a subset of https://rbcommons.com/s/twitter/r/1429 but poor rename detection was making that diff much harder to read. Splitting this into its own change should make the added functionality and tests easier to identify in that change.

Testing Done:
./pants goal test tests/python/pants_test::
https://travis-ci.org/pantsbuild/pants/builds/43414631

Bugs closed: 849

Reviewed at https://rbcommons.com/s/twitter/r/1444/
Load plugins pkg_resources entry point discovery