Improve code health

- Change string formatting to arguments in logging commands as it is the
  way logging is meant to be called.
- Tidy some whitespace.
- Change 'not x in y' tests to 'x not in y'.