Pass context to .forEach instead of closure

Has a slight performance improvement

closes #2346