models: fix instance.processes update
Merge pull request #53 from strongloop/feature/fix-processes-update

models: fix instance.processes update
Don't crash on runner exit after soft-stop

When issuing a soft-stop (either directly or via soft-restart) the
runner registered an event handler for 'exit' with the callback that
is given. Because that callback eventually bubbles up to a beforeCreate
hook on a ServerAction model instance, a phantom response is sent at
any point in the future when the runner emits an 'exit' event. This
manifests as Express throwing an exception because the callback
ultimately attempts to send a response, complete with new response
headers, on a response that has already been sent.

This went unnoticed because the tests did not trigger any restarts
after the soft-restart test and because there is no soft-stop test.
Initial import of persisted environment

This commit could almost be a standalone module as is.
Attach environment to commit

Environment is loaded from the Server instance and used for prepare and run.
Add env-set pmctl command

Restart goes through the existing replace mechanism which has been
updated to test for changes in environment. If the environment
variables of the replacement do not match the environment variables
of the current commit, then a hard restart is done instead of a soft
restart or replacement.
Add /env to test app
Upgrade node in Vagrant test VM
test: end-to-end for pmctl env-set
fixup! Add env-set pmctl command