- Moved mask_value_if_secret til after the method using it. Most
important/interesting method first, lower level/more detailed later.
- Made the logic in mask_value_if_secret simpler to understand, I think,
by making the two different cases more obvious.
- Split the test in two, as it actually tested two different cases.
- Changed the test names to explain what should happen, and not just
what is tested.
- Add a new test that tests the case which caused the crash: a setting
being None.