Refactor Bootstrap

This is a step towards eliminating our reliance
on provider storage, specifically for supporting
the uploading of tools during bootstrap. A followup
PR will remove the EnsureToolsAvailability function
and make environs/bootstrap solely responsible for
locating and delivering tools to the bootstrapped
instances.

- Environ.Bootstrap now returns the architecture
  and series of the started instance, and a function
  that must be called to finalize the bootstrap
  process. The caller is responsible for filling in
  the Tools of the machine config that is passed in
  to the finalizer.
- environs/bootstrap.Bootstrap now generates the
  system SSH key, and then calls Environ.Bootstrap;
  it finds appropriate tools for the instance based
  on the architecture and series reported, and then
  calls the finalizer.

There are some other refactoring changes:
 - MachineConfig.Constraints is now set by
   NewBootstrapMachineConfig, not FinishMachineConfig;
   only bootstrap machine configs actually set it,
   and the constraints do not change during the bootstrap
   process.
 - environs/manual/bootstrap*.go have been deleted,
   and the minimally required logic moved into
   provider/manual.
Remove old schema migration code (pre-1.18)
Revert "Add windows userdata"
Merge pull request #565 from juju/revert-189-add-windows-userdata

Revert "Add windows userdata" due to https://bugs.launchpad.net/juju-core/+bug/1359333
cmd/jujud: avoid potential race for UpgradedToVersion

Store the initial UpgradedToVersion as the the machine agent starts up
and use that when deciding whether HA initialisation is
required. Previously it could have been possible for the upgrade-steps
worker to update UpgradedToVersion before ensureMongoServer got to
check it.

The new previousAgentVersion field will also be useful for other
upcoming changes.
cmd/jujud: update upgradedToVersion even when upgrade mode is skipped

Recent changes to avoid entering "upgrade mode" unnecessarily have
meant that the upgradedToVersion field in a machine agent's config
wasnt't getting updated whenever upgrade mode is skipped. This can
have a variety of negative effects.

This change fixes that by writing the current version to agent.conf
when upgrade mode is skipped.
Revert "Run Godeps as a test"
Don't error in envcmd if we can't work out the environment until we actually need it.
Update comments, fix test
inline the error checks.
Merge pull request #567 from davecheney/revert-495-just-run-godeps

Revert "Run Godeps as a test"
Merge pull request #563 from howbazaar/remove-legacy-upgrade-code

Remove old schema migration code (pre-1.18)

The state.Open method was constantly looking to see if it needed to do a schema upgrade.

The comment indicates that this was done for the 1.18 release.  We are now post 1.20, and this no longer makes any sense keeping around.

The initialize method has been updated to assert that the new stateServerC documents don't exist.
state/apiserver/keymanager: canRead/canWrite is not a common.AuthFunc

This PR is a prereq of #556.

On investigation the `canRead`, `canWrite` authz methods in the keymanager are not implementations of `common.AuthFunc` as they do not use tags.

Although with the current defintion of `common.AuthFunc` the are interchangable, when #556 lands they not be as the `user` field transmitted over the api is not a tag.

To make this clear, stop defining `canRead` and `canWrite` in terms of `common.AuthFunc` to make this difference crystal clear.
logic cleanup, remove TODO
provider/common: fix test

expect version.Current.Series, not hard-coded "trusty"
responding to review feedback
Merge pull request #568 from howbazaar/fix-envcmd-ensure

Envcmd is more forgiving during init.

Don't error in envcmd if we can't work out the environment until we actually need it.
Merge pull request #566 from mjs/write-upgradedToVersion-even-when-no-upgrade

Write upgraded to version even when no upgrade

Two related changes here:

1. Store the initial UpgradedToVersion as the the machine agent starts up and use that when deciding whether HA initialisation is required. Previously it could have been possible for the upgrade-steps worker to update UpgradedToVersion before ensureMongoServer got to check it.
2. Recent changes to avoid entering "upgrade mode" unnecessarily have meant that the upgradedToVersion field in a machine agent's config wasnt't getting updated whenever upgrade mode is skipped. This canhave a variety of negative effects.

This change fixes that by writing the current version to agent.conf when upgrade mode is skipped.

See also: https://bugs.launchpad.net/juju-core/+bug/1359484
Ensure floating IP is used as public address for openstack
Fix comment