add unction to extract selection into its own component,this is going to be huge I see\!
add loops to check for all connections broken in the current selection
fix adding of components by click (was just addiing their dom \!)
and add code to hide menu when nothing is selected