Convert SocketNER class to use socket.makefile()

I was having problems getting the SocketNER class to work in Mac laptop
(OSX 10.8.2). After some fiddling, I found that using socket.makefile()
instead of socket.sendall()/socket.recv() seems to work consistently.