This exposes a couple of variables which were previously local to
handle_connect() to the command handlers, allowing them to make use
of the full command context.
All newly exposed variables are stored in an instance of the new
structure, and the command handlers now take a pointer to such
a structure.