jquery.makeCollapsible: Move functions out of the var statement

Converts function expressions into function declarations.
A 230-line var statement is too much for me to handle.

Change-Id: I22dc787229f2150dbad8de4e19a7fa034dcdca3d
Merge "jquery.makeCollapsible: Move functions out of the var statement"