Update validate.js

Small changes to pass JSLint with default options: Removed a few stray colons, re-declared vars and un-escaped chars.