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.
So as I mentioned it was late yesterday and I wrote some bullshit:

* the order of updates might matter, which is why we can not attach them to the updates variables

* we do not need to recurse currently as we can not do anything with the inner graph of Scans. Also we do not need updates from inner graph, do we? I have never done nested scans.