A wrapper to convert regular functions to continuation-passing style