Change ConstantFolding to only import necessary modules

Also fix bug I had with globals