Keep track of sidebar status

This is a simple usability fix: it keeps track of whether the user
has expanded or shrunk the sidebar so on future refreshes it
doesn't revert to the wrong state.