Promise optimizations

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