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.
That is because `updates` do not belong to a single variable, but they are result of `theano.scan` call and thus can be associated with an Apply node. And it gave me naturally a way to count every `updates` object once.