Move socket related code to sockets directory.