Added support for closures as validation methods.