Implemented 'to be canonical' assertion

Fixes #36.
We need to use shim.forEach here instead.