Move debug output block & some comment updates.
Make the javascript output a new method render_JavaScript()
Commentary.
New create_HIddenInputs method to create the hidden inputs string.