Minor cleanup.
Renamed set_value to set_option_value.
More refactoring of common option code.
More refactoring.
Fixed bug.
More refactoring of common code.