Added some more functionality based on the Promises/A+ spec.