Added handler for sb-int:simple-stream-error

And refactored some networking code, but changes are so small that you
won't even notice them.