Context creation, destruction, and event loop