Convert `mergePages` to Cadence.

See #375.