Add twisted support

- Add option using twisted to call callback functions in main thread from loop thread