Split struct event and related code into its own file.
Move event-related code to event.{cc,h}.