Merge Michael's work and fix some tests
Fix some collection names
Copy sessions in pinger
Update dependencies.tsv
Only copy session if a database login has been performed
Merge master and resolve conflicts
Fix megawatcher inconsistency
Code review tweaks
Found another place where collection needs to copy session
cmd/jujud: fix upgrade worker error handling

If the connection to state is lost then return an error so that the
machine agent will restart. For other errors, don't return the error
because we want the machine agent to stay running wait for user
intervention.

This change also adds tests for the handling of upgradeWorkerContext's
UpgradeComplete channel. This was previously untested.
Merge pull request #364 from mjs/upgrade-steps-worker-error-handling

cmd/jujud: fix upgrade worker error handling

If the connection to state is lost then return an error so that the machine agent will restart. For other errors, don't return the error because we want the machine agent to stay running wait for user intervention.

This change also adds tests for the handling of upgradeWorkerContext's UpgradeComplete channel. This was previously untested.
Merge pull request #361 from wallyworld/copy-session

Do not use global sessions

Each time a mongo interaction is performed, the session is copied using session.Copy() to ensure a fresh socket is used if needed. The basis of the change is to remove the "global" mongo collections on state.State and refresh each time one is used. A similar approach is used with the transaction runner.

The changes essentially follow the mgo driver guidelines:
newSession := session.Copy()
defer newSession.Close()
<do stuff with newSession>

During bootstrap, state.State is created using a session that has not had Login() called. For this case, the session is not copied as there are no stored credentials yet. An authenticated bool is added to state.State for this purpose.