clean up command handling and add support for arguments to the command-line