server: Use epoll instead of creating thousands of threads

Before this change the server created a thread for every incoming connection. Now we
can just have an epoll to monitor incomming connection and incomming messages.