Split from T227406. It should include the following patches:
- r507849 - Only touches caused-by lines
- r507981 - Handles closures
- r507986 - Handles variables used by closures
- r508082 - Code cleanup
- r508085 - Visits AST_EMPTY, straightforward
- r508124 - Explicitly mark as INAPPLICABLE a few node kinds, + visit exit() and clone
- r522077 - Just some debug logging
- r522140 - Switch back to phpunit for IDEs etc.
No relevant changes for consumers in this release.
After releasing, cherry-pick and abandon any remaining patch in the 2.x release and start working on master again.