Genericize events, add timer event, add key management state machine