MDL-45052 events: Cleanup lib/db/events.php