Split the event loop
Add LazyCanvas
Move some definitions to the ui package