Standard interfaces

Streams

For streams, the buffer can be either a number array OR a string. Both have length property and can be used with [] syntax.

Each stream may have its own preferences (it's JavaScript after all). I didn't want to make the interface too complex. For write, the stream is allowed to reject the call if it does not receive the expected format.