Support for validator 3.1.0

The latest version of `validator` is `3.1.0` and it includes extra validators that did not exist in `2.x` versions. The structure of the module has changed so I have updated the code to make it work with `3.1.0`.