Sonar violations

Fixed a pile of sonar violations. 

I picked on the logging of exceptions.

There's a bunch more exceptions in the test code within `functional-tests`. There's testing code in the `/src/main/java/` area, and so sonar hates on it. I stopped fixing in there, because I didn't see value in doing it.