made event categories map one to one to context type; split local/remote state events into distinct open/close and remote_open/remote_close events