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, etc: state.Info.Tag is now a names.Tag not a string
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.
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).
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
Merge pull request #278 from mjs/backups-in-env-storage

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.

There is more work to be done to add APIs to support management of these backups. This will be done at a later date by the Moonstone team.
Merge branch 'master' of https://github.com/juju/juju into 132-names-refactor-part-v

Conflicts:
	state/apiserver/backup_test.go
Merge pull request #267 from davecheney/132-names-refactor-part-v

state, etc: state.Info.Tag is now a names.Tag not a string

This change redefines state.Info.Tag as a names.Tag. 

This uncovered a lot of nastiness in the tests where an invalid tag was being used as a test fixture and then the incorrect result was asserted. An example of this is the agent.ConfigFile stuff which we all know _should_ write a file like fmt.Sprintf("%s-%s", tag.Kind(), tag.Id()), but the test fixtures were wrong.
Uniter API now has WatchActions

This commit adds state/api and state/apiserver endpoints for
WatchActions.
Added extra bits to api/uniter TestWatchActions