Added `sanitize_boolean` and optimized `validate_boolean` for readability a little.