Clean up and combined scripts into one script.

* Using OO programming
* use argparse
* use logging
* Comply with http://legacy.python.org/dev/peps/pep-0008/