Changing the way the the sidebar buttons work, so that filtering can be implemented. Work in progress. All the old stuff still works though.