STYLE: slicer.util.reloadScriptedModule - Reorganized code comments

Minimize confusion by associating a single comment with each section
of code.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22848 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: slicer.util.reloadScriptedModule - Ensure cleanup function can be called

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22849 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix "Reload and Test" function

While commit r22839 re-factored the code associated with "Reload" function,
it also made the "Reload and Test" function fails.

This commit fixes the issue by setting the "<moduleName>" key into
the global dictionary of the reloaded module so that it can be
referenced in the "onReloadAndTest()" function.

Note that the overall approach to reload modules could be revisited to
leverage either the "rollback importer" method or a more sophisticated one
like the "python-reloader" [2][3]

Thanks to "Csaba Pinter <csaba.pinter@queensu.ca>" for reporting the issue.

[1] http://pyunit.sourceforge.net/notes/reloading.html
[2] http://www.indelible.org/ink/python-reloading/
[3] https://github.com/jparise/python-reloader

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22850 3bd1e089-480b-0410-8dfb-8563597acbee