Autocomplete select box supports optgroups and removing of selected opti...

...ons
Extract to method handleSelect