Repacking connection, sockets into io
Move threaded behaviour into executable