Yes, with the global variables moved into the parameters. I wanted to first introduce this and then remove it from 04_... in the next step.

As for the location: tools/* should be used for general stuff only, but we can discuss this. My idea was that every analysis could have their own special set function in which case both src/<analysis>/lib.py and tools/<analysis>.py works. Any preference?