Fix tests broken by the OptionValidator changes.
The getopt library has a structure called option (lowercase). We have a structure called Option (uppercase). previously the two structures had exactly the same definitions, and we were doing a C-style cast of an Option* to an option*. C-style casts don't bother to warn you when you cast to unrelated types, but in the original OptionValidator patch I modified the definition of Option.
This patch fixes the errors by building an array of option structures and filling it out the correct way before passing it to the getopt library.
Note: So that the focus remains on the fix for the test failures, this patch does not include all the content of the original patch which was reverted. If this change is approved, it will go in as a single commit consisting of the original path (which has been reverted) combined with this patch.