Liveness analysis to avoid memory retention issues

- Adds an iterative, backwards data-flow analysis
- Make sure fields captured by nested defs are never zeroed out. This is done elegantly by declaring such fields a being live at the exit of the final state; thus, they will never be zeroed out.