Add basic restart functionality to the example
Allow graceful restarts by resetting state.