Support for more comprehensive harvesting mode vs binary safe-mode.
Changes after round 1 of reviews.
Merge branch 'master' into lp-1345553-harvest

Conflicts:
	environs/config/config.go
	worker/provisioner/provisioner_task.go
	worker/provisioner/provisioner_test.go
Update State.AddUser to validate username

Use names.IsValidUserName to validate the user and creator string
passed in to State.AddUser.
Merge pull request #650 from wallyworld/machine-doc-insert-order

Ensure machine doc is inserted last after any related docs

Maybe fixes: https://bugs.launchpad.net/juju-core/+bug/1354027

With debug turned on, it could be seen that the provisioner task was being notified of containers added to a host, which the provisioner then started to process. However, at this time, the machine records were not necessarily all written to the database yet. It turned out that for one container, its status document was not yet written, so the provisioner saw an error and ignored the container forever. A couple of seconds after this happened, the status record was written.

The txn ops to add a machine and its associated docs are re-ordered such that the main machine doc is created last.
Merge pull request #654 from waigani/AddUser-IsValidUserName

Update State.AddUser to validate username

Use names.IsValidUserName to validate the user string
passed in to State.AddUser.
Remove environs/tools.FindInstanceTools
Merge pull request #656 from wallyworld/machine-doc-insert-order-trunk

Merge pull request #650 from wallyworld/machine-doc-insert-order

Ensure machine doc is inserted last after any related docs

Maybe fixes: https://bugs.launchpad.net/juju-core/+bug/1354027

With debug turned on, it could be seen that the provisioner task was being notified of containers added to a host, which the provisioner then started to process. However, at this time, the machine records were not necessarily all written to the database yet. It turned out that for one container, its status document was not yet written, so the provisioner saw an error and ignored the container forever. A couple of seconds after this happened, the status record was written.

The txn ops to add a machine and its associated docs are re-ordered such that the main machine doc is created last.
wip
Merge pull request #649 from axw/remove-environs-tools-findinstancetools

Remove environs/tools.FindInstanceTools

Reduce surface area of environs/tools as we reduce reliance on it. Eventually the simplestreams parts should be relocated and become client-side, import-only. Several users do not need to be using FindInstanceTools (use FindExactTools or just FindTools instead).
mongo: don't depend on apiserver/params package

This PR removes the dependency between the `mongo` package and the `apiserver/params` package.

The cost is we inline the four fields previously declared in the `params.StateServingInfo` api message.

The `mongo` package now depends on

github.com/juju/errgo
github.com/juju/errors
github.com/juju/juju/cert
github.com/juju/juju/juju/arch
github.com/juju/juju/network
github.com/juju/juju/replicaset
github.com/juju/juju/service/common
github.com/juju/juju/service/upstart
github.com/juju/juju/version
github.com/juju/loggo
github.com/juju/names
github.com/juju/utils
github.com/juju/utils/apt
github.com/juju/utils/proxy
Fixed logging prefixes after moving state/api -> api/ and state/apiserver -> apiserver/
Merge pull request #659 from dimitern/fix-logging-after-api-move

Fixed logging prefixes after moving state/api -> api/ and state/apiserver -> apiserver/

After https://github.com/juju/juju/pull/655 got merged, I noticed some loggers are still using "state.api.*" and "state.apiserver.*", so this fixes these to drop the "state." prefix.

Also, added more logging to juju/testing/conn.go and state.Close() hoping to provide more context for fixing CI bugs like http://pad.lv/1348477.
Merge branch 'master' into lp-1345553-harvest
Fixes from review.
Merge branch 'master' of https://github.com/juju/juju into 192-mongo-dont-depend-on-apiserver-params
Revert to using curl to download tools

aria2 is in universe, which would preclude
juju from entering main. aria2 is also not
available on the test machines, and broke
CI. Revert to using curl, but cycle through
the URLs until one succeeds.

Fixes https://bugs.launchpad.net/juju-core/+bug/1364438
Merge pull request #661 from axw/lp1364438-curl-download-tools

Revert to using curl to download tools

aria2 is in universe, which would preclude
juju from entering main. aria2 is also not
available on the test machines, and broke
CI. Revert to using curl, but cycle through
the URLs until one succeeds.

Fixes https://bugs.launchpad.net/juju-core/+bug/1364438
fix error in juju bootstrap mock
apiserver/params: remove StatusData map alias