New logic of hiding/showing sidebar.

It now uses an internal state key and classes for animations. This means
sizes can be changed from CSS side.