Removed function `cast`. Updated aggregate functions parameters.

Fixes issue #2976 and #2975 
Removed the `cast` function from the declaration. These are not supported in the library.
Changed to the aggregate functions `all` and `race` to accept interface `Thenable<T>` rather than `Promise<T>`