[#11] Add functional encoding tests

- documents properly serialized to the server
- server properly serializes responses
- queries properly serialized to the server