fix(change-detection): When two identical pure functions removed

Fixes #787
Closes #788