Port the plugins to not use EnvName.
Merge pull request #260 from howbazaar/env-cmd-plugins

Port the plugins to not use EnvName.

This branch introduces another intermediate structure that provides a method to prepare the environment.
Don't pass pointers to set.Strings reference values

set.Strings is already a map type, a reference value if you like, so there is no need to pass its address, you're already passing a pointer to it.
Merge pull request #262 from davecheney/129-set-strings-is-already-a-reference-type

Don't pass pointers to set.Strings reference values

set.Strings is already a map type, a reference value if you like, so there is no need to take its address, you're already passing a pointer to it.
Use type switch in merge functions
Remove unused named return arg
fixed type
Push the key manager into the environment command.
Only expose the root in the base env command.
Update imports.
Implement the client api in terms of the root.
Restricted API for clients during upgrades

When an upgrade is in progress clients will be given an API root that
only allows a small subset of read-only API calls. Other API calls
will return an "upgrade in progress" error.

This helps to ensure that no state changes occur during an upgrade. An
attempt to change state while schema migrations are happening could be
problematic.
Merge pull request #214 from mjs/api-upgrade-mode

Restricted API for clients during upgrades

This is a little rough (with no tests) and is not intended for merging as-is. This demonstrates how the API available to clients can be restricted during upgrades.

With this change in place, most API calls made by clients will fail with an "upgrade in progress" error. A select few API calls used by commands for monitoring will still function. For example:

```
# During upgrade...
$ juju status
environment: local
machines:
  "0":
    agent-state: started
    agent-version: 1.19.5.3
    dns-name: localhost
    instance-id: localhost
    series: trusty
    state-server-member-status: has-vote
services: {}
$ juju deploy local:precise/dummy-source
ERROR upgrade in progress - method Client.EnvironmentGet is not available

# Time passes ... upgrade completes.
$ juju deploy local:precise/dummy-source
Added charm "local:precise/dummy-source-0" to the environment.
```
Merge pull request #263 from davecheney/130-refactor-merge-functions

Use type switch in merge functions

Followup PR from #262. 

* Use a type switch rather than a type assertion when checking for unexpected values in merge functions
* Drive by code cleanups.
Merge pull request #261 from howbazaar/env-cmd-auth-keys

Push the key manager into the environment command.

This means that EnvName isn't needed to get the API endpoint.