Refactor the "wrappers" and core function.

Instead of the core function baking-in the result in a `cond`, the
wrappers pass a function that is called to produce the syntax.