Turn "when.d.ts" into an external module

Enabling 'when.d.ts' to be also usable as an external module so that is can be included like 'import When = require(../when/when);'