Refactor to use states and transitions; also fixes #5
Fix removing of selected item and removing of all items; add an empty state;
hide clear mode toggle when list emptied (which stops the menu from popping up
altogether); select last item in list (if there is one) when currently selected
item gets removed - fixes #3 #4