Fix issues with un/registering message handlers during callbacks
Add support for Lua coroutines