COMP: Sort and run the examples topologically.

This way, by the time any file is run, its output will be generated.
Refactorings. Add the dependency generation code back in.
STYLE: Move module back into main example script file.
Don't exit the loop early, delete the extraneous code.
Only add pngs to be processed

Change-Id: I7b364978ca1b6531ee4befa0d55c66d3f40926d4