added protobuf and implemented internal messaging format