[GHC] #15977: Restructure typechecking modules