Abstract internal I/O through a new channel protocol
Clean up formatting
Add data zip writing (fix #8) and unit tests