WIP: BaseRecurrent and recurrent_apply_method

The scan related code is a typical boilerplate code
of which we had so much in Groundhog. This commit
introduces a way to get rid of it: a decorator that adds iteration
code to a single-step transition function.
Maybe we could re-use some of the initialization schemes here? So by default it's initialized with `Constant(0)`, but people could choose others as well.