Add support for promises.

This commit adds a very basic support for promises. The change allows developers to let rejected promises propagate in the same way an exception would. This is very useful if you're using a promise library (e.g. [q](https://github.com/kriskowal/q)).