Rework the options parsing to be more declarative.