Add state diagrams

This patch provides state diagrams for both the client library and the server.