Moved about half of the client commands to their own functions. This will help clean things up later.
Cleaned up the command-line argument flow control.