Some minor refactorings.

Simplify `when.reject` by utilizing `defer().resolve(reason)`.
Factor a `promiseFor` function out of `fulfilled`, `rejected`, and `progressing`.
Move `canonize` closer to the `Promise` constructor.
Add missing callback in `canonize`.
Move some of the core `when` exports closer to the definition of `when`.