Cosmetic fixes (indentation, trailing whitespace) in JS, new explanatory header