Move the slider Javascript to a separate file.

Document the flow of control.
Put the function into a namespace.
The images array is still a non-namespaced global.
Some cleanup in both files in the process.