close file before renaming

Renaming an open file is not possible on windows
resolve one TODO, replace with two more :/
testing: AgentConfigForTag now takes a Tag not a string
state/apiserver: Return filename from Backup API

This change adds a Content-Disposition header to backup API responses
which contains the server-generated backup filename. This becomes
important once backups start being stored server side (soon) but also
simplifies the client side of the backup API (no need to generate
backup filenames).
state, etc: state.Info.Tag is now a names.Tag not a string
Merge pull request #266 from mjs/backup-api-filename

state/apiserver: Return filename from Backup API

This change adds a Content-Disposition header to backup API responses which contains the server-generated backup filename. This becomes important once backups start being stored server side (soon) but also simplifies the client side of the backup API (no need to generate backup filenames).
Added test to ensure backup filename only uses plain characters.
Merge pull request #225 from gabriel-samfira/close-file

close file before renaming

Renaming an open file is not possible on windows
Merge pull request #273 from mjs/backup-filename-test

Added test for backup filename

It is important that the filename is 7-bit ASCII because it is returned in a header (unencoded) by the backup API call.
Actions :: actionWatcher consume initial events

... safely, by accounting for potential race condition between
registering the watcher and finding previously queued actions
Update the user manager commands.
WIP style guide
Merge pull request #250 from waigani/style-guide

WIP style guide

First pass at a style guide. Most of this *should* be common sense. Yet, as everything listed here frequently comes up in code reviews, there is arguably a need to make common sense a little more common.

I expect there will be some debate over what is a juju convention/style vs someone's opinion. As such, I provide this doc only as a starting point and I am not attached to any given convention in there. The benefits of agreeing on and clarifying our conventions upfront are: easier 'on-ramping' for newbies and quicker reviews.

I will start a juju-dev thread for this PR, please use it for debating what should/shouldn't be in the style guide (or even if you disagree that we need a guide).
use short decl for initial and err per code review comments
Merge branch 'master' of https://github.com/juju/juju into 132-names-refactor-part-v

Conflicts:
	agent/agent_test.go
	environs/cloudinit/cloudinit_test.go
	environs/cloudinit_test.go
	state/open.go
Merge pull request #265 from davecheney/131-names-refactor-part-iv

131 names refactor part iv

testing: AgentConfigForTag now takes a names.Tag not a string.

Resolving the type of the tag returned from AgentConfig.Tag() will require more effort.
Merge branch 'master' of https://github.com/juju/juju into 132-names-refactor-part-v
fix panic when info.Tag is nil (user is admin)
state/apiserver: keep backups in env storage

Whenever the backup API is called keep the backup tarball in
environment storage in addition to returning it to the client. Among
other things, this will be used to support rollback when upgrades
fail.
state/apiserver: close backup files once returned