WIP: Make SequenceGenerator functional again.

This involves bunch of changes in the core to be reviewed by @bartvm.

This is work in progress: I have not yet even touched documentation, for instance. But most of the stuff is there.
Just started going through this. Is there a reason you are adding the updates to the owning `Apply` node, and not to the value itself?

```python
for var, update in updates.items():
    var.tag.updates = getattr(var.tag, 'updates', []) + [update]
```