Encoding

As in #105, this allows you to set the encoding for:

* a write stream
* each chunk in a write stream
* each operation in a batch

I added tests and documentation.