Preheat the oven to 375°F. Bring a large pot of water to a boil over high heat.
Meanwhile, melt the butter in a large pot and add the onions. Saute until the onions are softened, and then add in the flour, stirring constantly.
When the flour mixture starts to bubble, slowly stir in the milk, salt, and pepper. Keep stirring over medium-high heat, and once the milk has warmed up a bit (it should be warm to the touch but not anywhere close to boiling) add in the shredded American cheese.
Stir until creamy. You shouldn’t see any strings of cheese left in the mixture. Lower the heat and continue stirring constantly, or else it will stick to the bottom of the pan.
When the pasta water comes to a boil, salt it and add the pasta, cooking until almost al dente. Do not overcook the pasta because it will get mushy once it bakes. Remove the cheese mixture from the heat, and then strain the pasta in a colander.
Add the strained pasta to the cheese mixture and combine until well mixed. Pour the pasta and cheese sauce into a greased 13-by-9-inch baking dish.
Combine the crushed crackers and melted butter in a mixing bowl and then sprinkle over the top of the macaroni and cheese.
Bake covered for about 45 minutes. Uncover, then bake an additional 10 to 15 minutes until the crumb topping is golden brown and the edges are bubbly.
Let the macaroni and cheese cool for at least 10 to 15 minutes before serving to allow it to set.