Mainloop reorg
Depends on !7 (merged) - this re-arranges the mainloop to better match the recommended flow.
- Event polling is now before waitframe, so we can cancel as well as so we don't include that in frame-time estimation.
- Begin frame is now after action updating. Ideally action updating would be before waitframe, too, but that's a little tricker here, so I just left a TODO.