recursively select the first choice, to make sure `selected` is a scalar, even when `choices` is a list of lists (optgroup)
closes #326: generate <optgroup> when `choices` is a named list of choices

note the nested level of optgroup can be greater than one here, however, the HTML4 spec only allows one level, i.e. optgroup must have select as its direct parent http://stackoverflow.com/q/1037732/559676
choicesWithNames() should also consider the optgroup case now: all optgroup nodes must be named
validateSelected() does not validate `selected` for the optgroup case; this function is only for shiny <= 0.9
factor out the code to generate options from checkboxGrouptInput() and radioButtons(), and use the new generator generateOptions() for them
make updateSelectInput(), updateCheckboxGroupInput(), and updateRadioButtons() work

now session$sendInputMessage() does not send options as the choices data, but as a pre-generated raw HTML string; in shiny.js, we just receive this string, and .append() it to the input after the input is emptied
when choice is not a list, we need to return its first element
when we need <optgroup> for the child elements of `choices`, we just generate it no matter what the child element is

e.g. we use <optgroup> for A even if A only has one element: list(A = 'a', B = c('b1', 'b2'))
inherit doc for updateFooInput() from fooInput()
rename newOptions to config
R CMD check will warn against the possibly missing variables `inline` and `type`
Always convert choices to a (named) list

Converting it to a list, and ensuring that it's a named list reduces
many checks elsewhere.
Add tests for choicesWithNames
Slight clarification of comment
selectOptions: handle mixed options and optgroups
Add tests for selectOptions
Add tests for default selected items
Make listify work on nested lists of depth > 1
Add tests for deeper nesting with choicesWithNames
explicitly define updateSelectInput() instead of using the trick to change the `options` argument of updateInputOptions()