Refactor option parsing internals to support strict mode