Use when.js polyfill

This code uses the when.js promises polyfill.

While this increases the minified code size from 15KB to 22KB, it is a much faster implementation (as in visibly noticeable even running the tests, which is critical for module loading), and opens up IE8 support potentially.