Move the connections dict into the scope of main loop function

Looks like it was unnecessarily global because we planned to
add-remove from some kind of wrapper. We'll restore it to the
global scope if such ever occurs.