Refactored Worklist and ConstantFolder. Compiles but segfaults
Fixed segfault