Get rid of global main loop
Add create_async_loop