make the episode/time step/iteration begin and end callbacks consistent

... and in the case of iterations add them to the problem.

(the callback methods are supposed to be called beginFoo() and
endFoo().)