Made the mgen compiler's code generation multithreaded