Core event class and serialization helpers.