abstract out run logic, add shutdown protocol.
tests for startup and shutdown, with failing exits.
this commit adds tests for both methods of exit code failure inside a scheduler