Make the code strict mode-compliant: declare variables before using them in "if" condition

Also, some trailing whitespaces removed by my editor.
"required" rule support for radio inputs

Multiple radio inputs share the same name in the form, but vary in values; therefore form["foo"]
is not an HTMLInputElement, but rather an array of HTMLInputElement-s.
Merged in pull request #25 from ikr.