fix for when a required field is boolean type

- before this change a required boolean field with a false value would
  not validate properly. This patch uses a guard to test for the field
  being a boolean type in the required validator function.
- also adds tests for a model with a required boolean field.