Added basic connection management

Added basic connection management for accepting connections, removing
them when they timeout, and receiving messages from them.