Added option to set initial collapsed/expanded state

Applicable when state is not saved in cookie.