New client design

This is a backward compatibility break, but since version is still 0.x it's ok

- [x] write to stream
- [x] read stream
- [ ] phpdoc