#1666 Made constant optimization and impact/replacement-values calculation async and added progress indication.