Move TCP server to its own module