Continuation passing (complete with memoization and CBV / CBN switch)