Switch from optparse to argparse

This simply does the library switch, without changing any commands or options.

Part of #437.