@rockyb Thanks! I've submitted most of the commits as merge requests. There's one against 4.4 and one against 5.1 where applicable. I've kept most PRs to just one commit to help with the review.
4.4: Fix pollution by global variables
5.1: Fix pollution with global variables
5.1: Fix gitignore for logging test
4.4: Fix test-settrace
5.1: Fix test-settrace
4.4: Fix tests with pygmentize
Fix tests with pygmentize