Move event-related code to event.{cc,h}.