Make constant propagation smarter about pruning if statements

The `this.remove()` call was overreaching and removing the entire parent `if` statement. A more conservative approach is just to replace the `if` statement with `null`.

cc @zpao @petehunt @spicyj