getopt should consume options terminator "--".

As stated by the docs. (Cf. issue 9583)
Add unittest.
Improve code based on feedback.
Revert "Merge pull request #1170 from jmdavis/perf"

This reverts commit 684c43dfc52105b232641965702a10295d0ba7cb, reversing
changes made to 707a60101b41ac54af2f757beec89875fe51ac37.
Merge pull request #1159 from quickfur/getopt_optend

Fix issue 9583
fix Issue 9596 - Ambiguous match is incorrectly hidden by additional lesser match
Fix issue 4921 - Synopsis code in std.variant documentation throws an assertion error

http://d.puremagic.com/issues/show_bug.cgi?id=4921
Merge pull request #1177 from 9rnsr/fix9596

Issue 9596 - Ambiguous match is incorrectly hidden by additional lesser match