Examples: refactor all examples with a MainLoopStep() function, to facilitate use with Emscripten. (#2492, #3699)

Aligned all examples.
18 files changed