jquery.makeCollapsible: events for collapsing/expanding, tests

Trigger a custom event to allow callers to hook to the
collapsing/expanding, allowing the module to be testable and making
it possible to e.g. implement persistence via cookies.

Added tests for the triggers themselves and for some basic
asynchronous collapsing functionality.

The following four events are fired (the namespace used is the same
one as the one used for firing the click event for initial toggle):
* beforeExpand.mw-collapsible
* beforeCollapse.mw-collapsible
* afterExpand.mw-collapsible
* afterCollapse.mw-collapsible

Change-Id: I580365770d061418a6734fcb54b2d86f2a821748
Merge "jquery.makeCollapsible: events for collapsing/expanding, tests"