Implement basic connection handling and management

Implement the basic system to accept and manage TCP and UDP connections.