skip other validations if allowNull is true and value is null

This fixes #270 and #118. I added tests (first ones I've ever written, so I hope they're okay) which pass, and no other tests were compromised.