Added more tests and minor refactorings on CustomSqlValidationHandler. refs #435