Changed cps implementation into ES6's generator spec