Currently Application.EventHandler persists Go contract events to disk via the EventDispatcher at the same time as it notifies websocket subscribers of these events. The problem is there's no check when the node starts up that events have been successfully persisted to events.db for the last persisted block, which means that some events may get lost if the loom process dies for any reason mid-way through writing out those events. We need to make event persistence more reliable by keeping track of the last block for which events were written out (in events.db) and replaying blocks to regenerate the missing events if necessary.