some bug fixes and improvements
tree control expansion state persistence and tab closure logic fix