Added expand/collapse callbacks. To avoid register events on specific elements
Added minor changes to fullfill jslint standard validation criteria