Update State.AddUser to validate username

Use names.IsValidUserName to validate the user and creator string
passed in to State.AddUser.
Move state/api and state/apiserver to top level

This is a follow up to #653 that finishes the general code migration.
gofmt
Merge pull request #655 from davecheney/191-move-state-api-apiserver-to-top-level

Move state/api and state/apiserver to top level

This is a follow up to #653 that finishes the general code migration.
Merge pull request #650 from wallyworld/machine-doc-insert-order

Ensure machine doc is inserted last after any related docs

Maybe fixes: https://bugs.launchpad.net/juju-core/+bug/1354027

With debug turned on, it could be seen that the provisioner task was being notified of containers added to a host, which the provisioner then started to process. However, at this time, the machine records were not necessarily all written to the database yet. It turned out that for one container, its status document was not yet written, so the provisioner saw an error and ignored the container forever. A couple of seconds after this happened, the status record was written.

The txn ops to add a machine and its associated docs are re-ordered such that the main machine doc is created last.
Merge pull request #654 from waigani/AddUser-IsValidUserName

Update State.AddUser to validate username

Use names.IsValidUserName to validate the user string
passed in to State.AddUser.
Remove environs/tools.FindInstanceTools
Merge pull request #656 from wallyworld/machine-doc-insert-order-trunk

Merge pull request #650 from wallyworld/machine-doc-insert-order

Ensure machine doc is inserted last after any related docs

Maybe fixes: https://bugs.launchpad.net/juju-core/+bug/1354027

With debug turned on, it could be seen that the provisioner task was being notified of containers added to a host, which the provisioner then started to process. However, at this time, the machine records were not necessarily all written to the database yet. It turned out that for one container, its status document was not yet written, so the provisioner saw an error and ignored the container forever. A couple of seconds after this happened, the status record was written.

The txn ops to add a machine and its associated docs are re-ordered such that the main machine doc is created last.
Merge pull request #649 from axw/remove-environs-tools-findinstancetools

Remove environs/tools.FindInstanceTools

Reduce surface area of environs/tools as we reduce reliance on it. Eventually the simplestreams parts should be relocated and become client-side, import-only. Several users do not need to be using FindInstanceTools (use FindExactTools or just FindTools instead).