bd: move rstrip into BackdoorShell
bd: use WeakSet to implement broadcast