Added `required_if` validation rule. Closes #1041.