- added a context object for buffering writes similar to the way the decoder context for reads from stream
- added unit tests for the encoder context