Promise optimization

A few (react/)promise related optimizations. Detailed explanations in the commit messages.