Collapse improvments

Added a button to toggle states of panels.