More consistent default handling for StringOption

For enumerated StringOptions, the enum indexes were not always
consistently handled.  Added a few tests for the behavior, and fixed it.
Now the storeEnumIndex() option works consistently in that if the caller
specifies an initial value for the variable, and there is no other
default, the caller-provided value is preserved.  Also, the stored enum
index is properly updated if a default value is provided through a value
in the output variable.

Fixes #1586

Change-Id: Ib9d24e977dbfde6b23ba90271574cdd43c70c1bd