updated Validator to work as an NPM module.