Bind `socket.end` to the `socket` object.
Test establishing and closing a connection.
Merge pull request #6 from kitcambridge/master

`socket.end` should be bound to the `socket` object