Renamed the codegen module, fixed bug in detecting main function