Added a command function to allow easier control over telnet.