Convert sidebar and toggle button to a class

There seems to be _something_ that prevents the last commit from ever
working, but what?

[ci skip]