Define factorial in continuation-passing style