Started on rewriting the protocol framework.