Socket generalisation

This series of patches generalises the test suite to make supporting multiple socket types simpler. Functional test suites for different socket types are now generated from common a common suite of tests.

This prep work simplifies adding support for Unix domain sockets, though there are some edge cases surrounding behaviour differences between Inet socket and Unix sockets regarding socket disconnection that I'm purposely deferring to a later pull request.