Add parent tracking and mutation to AST visitors

Fixes #916