Refining main event loop, more window actions.

Getting a little more sophisticated on the event loop and added raise
and hide actions for the Window class.