Port stuff from old compositor

lots of stacking functionality ported
still need window focus and mouse events, plus mouse move and other
server-side control...