Move getMainFun to TcRnDriver, trim DynFlags imports