added some documentation to validator.js.