Collapsible: Move handleExpandCollapse() to a widget-level function.

There's a slight performance hit wrt. 08fa6fc9172391f9f330457b988c8272a0ad33f1: http://jsperf.com/collapsible-cleanup