Introduce protocols for different implementations.

Sketch high-level API.