display.c is getting a bit crowded. Move most of the handling out to another file, events.c. The long-term goal is to have generic event handling here, with backend-specific handling for the types of windows and such.