Move the command-line driver components into cmd.py. No functional change. Change-Id: I1919f6e865acae14ee95cd025c9c7b75ca266a9c