Upgraded optparse code to argparse, and added some more TODOs.