Added ItemSelector.
Extend OptionSelector and fixed various bugs.
Added tests for both OptionSelector and ItemSelector. Fixes: https://bugs.launchpad.net/bugs/1169258, https://bugs.launchpad.net/bugs/1218247, https://bugs.launchpad.net/bugs/1218250.
Approved by PS Jenkins bot, Zoltan Balogh.