[cli] consolidate flag-from-env code, print global options in sub commands (#864)
[cli] consolidate flag-from-env code, print global options in sub commands (#864)

This diff is big, but mostly because of boilerplate changes.

Start with:
- `os/os.go`: an interface with a subset of golang's `os` package, to let us mock it.
- `flags/fromenv.go`: all of the flag/env nonsense is now consolidated into one interface, which simplifies the interaction between `cli.CLI` and `app.Usage`. One change in behavior is that sub-command env flags are now prefixed by the sub-command.
- `cli/cli.go`: modified to use the above, tests rewritten to use mocks. Also added a `Validate` method that will ensure that there is no potential overlap between various environtment keys, since the namespace is smaller for bash variables than for flag names.
- `cli/app/usage.go`: modified to use the above, and to print global options for sub-commands. fix up tests.
- modify all current callers of `cli` to add a test to validate flags. `Validate` is also called at runtime, but this way we'll catch it when tests run. This is what clutters up the review, and if it's distracting I can pull that out into another branch.

fbshipit-source-id: cb265d0

turbinelabs/test,turbinelabs/test