Nigel's Socket code integrated

Nigel's socket code has been extended, and then integrated into the
circuit code. However no multi machine tests yet. Instead, I shall go to
them mythical land of sleep...(Rambling commit message over)