Rewrite argument parsing code with argparse

`argparse` parses things better than we were doing ourselves, adds help and usage information, and isn't much longer.