Expand/collapse functionality. Resolves #1.