breaking things out from protocol.go
got longer replies working, split to multiple files