Unregister when we get a DestroyNotify
Drop grabs on viewability, not destroy
Only respect the client window for DestroyNotify/UnmapNotify

Otherwise, we'll get BadWindow errors.
Remove leftover inheritance

It seems this was left here by accident.
Remove task framework

Use a manual setTimeout ourselves to reschedule.
Implement focus reverting
Make frameWindowId private

Simple code cleanup.
Use the standard method of flushing event queues
Rename the frozen event queue

To ensure that we deliver events in the correct order, we
need to move the client event queue to the server. Make
way for the new queue by renaming the old one.
Remove unparentWindow

It's unnecessary.
Revert "Send events to clients in the next iteration of the mainloop"

This reverts commit e2d14d131f574593e2dda86da0c5caa250e08c7b.

This is actually incorrect -- we need to order events globally, not
per-client, and multiple setTimeouts aren't defined to have any order.
Create the root window last

We need the event infrastructure up by the time we create the root
window.
Remove the initial full-stage redraw

Creating the root window will damage the window.
Move to one mainloop function

setTimeout callbacks may interrupt one another, so we really
should only have one main loop.