Convert `replay` to Cadence.

See #375.