fix callback issues
use a message passing model to manage connections
abstract connection thread into separate object
add another disconnect test
fix bug in disconnect