JS style and comment cleanup
Add the index for scale calculation

This lets events query the DOM for the index of a particular image.
Variable cleanup

Simplifying the variable names and extra definitions.

Moving the dev cursor calls down to the bottom of the document so that
they can access all the variables.