Separate stream and socket abstractions

Well, somewhat separate.