Added connect, disconnect, and retry commands, and made them work. Fixed bug in server on disconnect.