emit "publish" event when adding states
make sendMessage always async
re-enable tests