Redone the sidebar menu from scratch

Added scripts to control the menu behaviour.