Multi threaded connection processing

Each connection is now processed in a dedicated thread. This allows the
client to send multiple requests simultaneously (which most browsers
do).
BUG: connection id generation is faulty, always generates same id