Add thread context.
Remove event queue from main module.
Change async proxy to use thread context and threadsafe attribute.
Use thread context.
Test async behaviour for multiple state machines.