Moved most of the sleep code into the Window class.
Input is now consumed on wake.