Rewrote protocol for both server and client to use same class.