fixes; core improved; optgroup tag support added

checkboxes mode worked very bad in some cases