Merge pull request #1084 from fwereade/uniter-context-export-flush

Uniter context: export FlushContext

Most of the tests for finalizeContext, which is *complex* (not to mention complicated...) were invoking it by side-effect. So, it was really not well tested at all; to rectify this:

* context.Runner now uses a context.Context interface, not an explicit *HookContext
  * the finalizeContext method became FlushContext
  * the hookVars func became a HookVars method
  * the context ActionData method replaces an ad-hoc combination of similarly horrible access methods
* the various flush tests that depended on running a fake hook are now calling FlushContext directly; and slightly more than before, although (tbh) not *enough* by a long shot
* context.Runner.Run* methods are now tested using a mock context.Context, so we now have *actual tests* that the contexts get flushed
  * makeCharm/hookSpec now creates scripts in arbitrary dirs, so we can actually *test running an action* /grrmbl
Tweaked upgrade target selection

upgrades.PerformUpgrade() now takes all the upgrade targets for the
machine being upgraded instead of being called once per upgrade
target. This removes the possibility of upgrade steps being run twice,
simplifies the upgrade-steps worker and also ensures upgrade steps are
run in a more readily understood order.
Remove special casing for the databaseMaster upgrade target

Nows that upgrades.PerformUpgrade() is called once with all targets
for the machine being upgraded there is no need to treat
databaseMaster as a special case. The master state server now gets
two upgrade targets: stateServer and databaseMaster. This simplifies
the code and tests.
Merge pull request #1097 from mjs/upgrade-target-selection

Tweaked target selection

Tweaked upgrade target selection

upgrades.PerformUpgrade() now takes all the upgrade targets for the machine being upgraded instead of being called once per upgrade target. This removes the possibility of upgrade steps being run twice, simplifies the upgrade-steps worker and also ensures upgrade steps are run in a more readily understood order.

---

Remove special casing for the databaseMaster upgrade target

Nows that upgrades.PerformUpgrade() is called once with all targets for the machine being upgraded there is no need to treat databaseMaster as a special case. The master state server now gets two upgrade targets: stateServer and databaseMaster. This simplifies the code and tests.
Refactor InstanceBroker.StartInstance to return result struct

StartInstance will soon need to grow another result for
reporting back block devices allocated to a provisioned
instance. Rather than having to touch every bit of code
each time we expand the set, use a result struct.
Merge pull request #1100 from axw/environs-startinstanceresult

Refactor InstanceBroker.StartInstance to return result struct

StartInstance will soon need to grow another result for
reporting back block devices allocated to a provisioned
instance. Rather than having to touch every bit of code
each time we expand the set, use a result struct.
Merge branch 'master' into uniter-action-context-2