Add some helpful modules from ccan.
socket: convert connections list to a hashtable

This makes it a lot quicker for searching if there are many connections
stored.
select: fix an infinite loop

The variable `fd' was mis used in that loop, I forget too much.
Shorten down license headers into 2 lines for a less boring source code
Minor cleanups and fixes