foton.py Module class is coupled with its name
The Module class in foton.py gets an associated libfilterfile FilterModule object with the fm() method. Typically, this method calls a closure that calls FilterFile.find(module-name) each time fm() is called.
FilterFile find returns a FilterModule object that's tied to a pointer internal the FilterFile object, but this pointer can be deleted by other operations, invalidating the returned python object. The using the invalid object probably leads to a segfault.
Instead, the closure allows us to raise an exception on a failed call to find().
However, the module is then tied to its name. If the name is changed, the closure is now searching for the wrong name.
Also, Modules created in some other fashion still need a closure. How do we create an independent Module object? Maybe we have to pass a closure that memoizes somehow a independently constructed FilterModule object. This would work but is awkward. We at least would want some sort of helper for this.