Refactored GhcModi to better handle multithreading.