miscelaneous changes before a big update.
Reimplement opterator to use argparse.

This made the code quite a bit simpler and more robust. It also allows
supporting other cool use cases in the future.

This was a big rewrite. The existence of a comprehensive test suite makes me
quite confident there are no regressions.