Switch to using argparse rather than parsing manually