Added new `opts` argument to setExpanded()

Closed #128
Closed #129