SelectBinding should handle dynamic optgroups

Related to #1029 

The static optgroups test passes, but the dynamic one fails. I'm not sure where to continue with this though ...