Changed command line parsing to use argparse as it's recommended to use
in python 2.7+.