Upstream merge branch

Merge upstream changes (translated as required). Just one Async class (cancel doesn't work if it is a schedule in the legacy version) rather than separate classes/structs with the return value and the static/class methods.

Also modified the test to print less debug and fixed a cancel bug when chaining from cancelled methods.