Refactor stop handling in server

- Add test for stopping while a run action is outstanding

Signed-off-by: Sheel Choksi <sheelc@pivotallabs.com>