Adding a "required" validator.
When the "required" option is true, use the default "required" validator. Otherwise, use the passed-in validator.
Use String() instead of the toString prototype method.