streams2 and explicit encodings

This patch uses streams2 and makes the encodings explicit instead of implicit like before. This patch adds support for the following encodings (with room for more):
* buffer (the default)
* array
* string
* uint8array