fix #3: Add optgroups support