Fix Constant Folding with Imports analysis

The change to the passmanager (adding an entry for the current module in the modules table) introduced a bug in constant folding, which used the modules table to deduce the imports.

Now we use a cleaner way to gather imports, thanks to a new analysis.