Added a new foreach operation that supports graph modifications.