Bring promise implementation more in line with es6