Add compression, slightly refactor write()

Fixes #21
Add docstrings to client and server

Whew!