Small promises/a+ implementation.