Add expand/ collapse links to a tree widget.
more work.
Fix JS.
Add doc.
Merge pull request #5922 from openscholar/5875-collapse

Add expand/ collapse links to a tree widget.