refactor command functions and connection object

The command functions are no longer in an object. Also, the call_bz
function and token handling are now part of the connection object.