A+ promise implementation