Connects to the debugger

Refactors socket in its own file