window.addEventListener('load', function() { messaging = Messaging(); async = Async(); dom = Dom(); screen = Screen(dom); session = Session(); buttons = Buttons(session); automaton = Automaton(async, buttons, dom, messaging, screen, session); messaging.start(); automaton.run(); });