Added functionality to the UI and Agent that will help to intergrate Crank into D-Crank

also add a callback for stopping workers (the graceful scenario)