Clean up and combined scripts into one script.

* OO programming
* use argparse
* use logging
* Comply with http://legacy.python.org/dev/peps/pep-0008/
Added command line option to send a single command.