Improve reporting

Make Logger, UsageReport and exception reporting more thread safe. For details see commit messages.
Massive whitespace changes make it almost impossible to see what really changed here