add Packet class, more protocol changes

Signed-off-by: Andrew Tselischev <andrewtselischev@gmail.com>