Make TOC panel collapsible

Also refactor sidebar.less somewhat and tweak styling, event handlers
to collapse/re-enable toc panel.