[BUGFIX] Allow all commands to be associated on the wire

Give commands an internal ID used when they are requested. In the case of components, this is only useful for the original request, and is superseded by the component ID when it is provided by the server.

Also add some test coverage to the XMPP connection while we're fiddling here, and remove some dead code that resulted from the low test coverage.