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.
`updates` doesn't, but the keys in `updates` are variables, right? So to me it seemed more natural to store the update to a certain variable on the variable in question. I guess this works too though.