Fix for #1742

Add checks to ensure that a null string always fails validation on nonEmpty, minLength, maxLength and pattern constraints.
Add requires() to parameters on text, minLength, maxLength and pattern to ensure that parameters are valid and non-null.
Add specs for above.