Dyamic sidepanel boilerplate

Much code to be honest.

Please take a look.