Pass context to .forEach instead of closure

Has a slight performance improvement

closes #2347
examples: make main app file names consistent

fixes #2408