Update validate.js

Small changes to pass JSLint with default options: Removed a few stray colons, re-declared vars and un-escaped chars.
Merged pull request #54 from i-like-robots.