encoder: avoid recursive encoding
decoder: rename protocol function
encoder: rename protocol function
README: update to new protocol functions