Refactor logging, small output tweaks.

- Move log creation to a separate module.
- Don't output json to log files.