Fixed a couple checkSegments calls.
Added click to toggle selection, more firing of selection changed, and methods to get/restore expanded nodes.
Merge remote-tracking branch 'origin/master'