A class to make command-line option parsing easy.

This is taken from https://github.com/mjijackson/optionparser plus a few
modifications to the exception handling to make it better.

The new script to run tests needs this.