Added promise support.

Broke backwards compatibility though. Oh well!