Fix bug in upgrade test

oldID is converted to a string. Which is different to the the bytes
version stored in the document.
Merge branch 'master' of https://github.com/juju/juju into fix-upgrade-bug
State Upgrade steps: Add EnvUUID to settings and settingsRefs

Add two upgrade steps which prepend the environ uuid to the _id field
of the settings and settingsRefs collection. Refactor TestChange in
megawatcher_internal_test.go to allow test cases to be configured with
a state instance (the refactor also removes about 100 lines of code).
Refactor state/upgrades_test.go to support collection specific
overriding of the generic checkAddEnvUUIDToCollection and
checkAddEnvUUIDToCollectionIdempotent.
Merge branch 'master' of https://github.com/juju/juju into migrate-settings

Conflicts:
	state/upgrades_test.go
	upgrades/steps121.go
Merge branch 'master' of https://github.com/juju/juju into migrate-settings
Merge pull request #1065 from waigani/migrate-settings

State Upgrade steps: Add EnvUUID to settings and settingsRefs

Add two upgrade steps which prepend the environ uuid to the _id field
of the settings and settingsRefs collection. Refactor TestChange in
megawatcher_internal_test.go to allow test cases to be configured with
a state instance (the refactor also removes about 100 lines of code).
Refactor state/upgrades_test.go to support collection specific
overriding of the generic checkAddEnvUUIDToCollection and
checkAddEnvUUIDToCollectionIdempotent.
Merge branch 'master' of https://github.com/juju/juju into fix-upgrade-bug
Merge pull request #1011 from waigani/fix-upgrade-bug

Fix bug in upgrade test

oldID is converted to a string, which is different to the the bytes
version stored in the document.
Stop trying to use DNS name for ec2 public addresses
Drive by format fix
upgrades: moved Step and Context to their own files

In preparation for upcoming changes where State requiring upgrade
steps will be separated from API requiring ones.

Also removed unused "db" and "runner" fields from upgradeContext.
upgrades: introduce StateStep

It's now part of the Operation interface, but not used yet.
upgrades: StateSteps are now run as part of upgrades

All StateStep upgrade steps for a target are now run before other
upgrade steps. Existing migration steps still need to be migrated and
there's a number of cleanup steps required before this work can be
considered done.
upgrades: migrated steps that manipulate state directly to be defined as such
upgrades: introduced APIContext

This is a limited upgrade context give to upgrade steps that use only
the API. Existing steps like that have been updated to take APIContext
instead of Context.
upgrades: test refactoring

Extracted the common parts of mockStateUpgradeStep and
mockUpgradeStep, making the targets() helper unnecessary in the
process.
upgrades: various changes based on review feedback

The crux of this change is that the role of StateContext and
APIContext have been taken over by the base Context interface. This
also allows for a single step interface which allows for
simplifications throughout.
upgrades: completely separate state and API based steps

These 2 types of steps are now defined in separate lists. This makes
the package even simpler and allows further simplification.
upgrades: iterator refactoring

Moved iterator to operations.go (more appropriate place), made name
shorter and added convenience constructors.
Merge pull request #1090 from wallyworld/unit-public-address-ec2

Unit public address ec2

Fixes: https://bugs.launchpad.net/bugs/1308374

The EC2 provider waits for the instance to advertise its DNS name, and when it does, it inserts this as a public address against the machine. 
The unit's get public address method looks at the slice of machine addresses recorded and picks the first public one. If the DNS name is available before the first public IP address is recorded, this will be printed as the public address. So you sometimes get an IP address, sometimes a DNS name.

People want to get just IP addresses for unit's public/private addresses. So the EC2 provider recording of DNS name has been removed. This means that the juju status dns-name value will show an ip address, but that's what happens for HP Cloud and some other providers anyway, and we also want to get rid of dns-name. 

Also a drive by fix for a go vet issue.