Start new/close window functionality.

Remove meaningless size parameter from NewCompositeWidget.
Remove widgets global, use canvas widget for input.
Refactored end of main loop.