Changes to implement crash recovery. Has been tested with a couple of tests doing service shutdown/startup. Will implement a test specific for this.