Bring a large pot of water to a boil and salt the water. Add small shell pasta and cook the pasta to al dente doneness which means that the pasta will still have a bite to it or be a little chewy. Cook probably 9-10 minutes.
Preheat a deep, big skillet or a medium sauce pot over medium heat.
Place garlic on the cutting board and place the flat of your knife on top of each clove. Carefully give the garlic a whack with the palm of your hand to seperate the cloves from the skins. Throw out the skins and chop up the garlic.
Add EVOO to the pan by pouring a slow stream of it twice-around-the-pan. Do not let the oil pour out too fast. Add the garlic to the oil.
Chop onion finely. Add to garlic and oil. Cook, stirring frequently, five minutes or until onions are tender.
Add the tomatoes to the onions and stir. When the tomatoes come to a bubble, reduce the heat under the sauce to low.
Stir in basil pieces to wilt them. Season the sauce with salt and pepper to your taste.
Preheat your broiler to high and place a rack in the center of the oven.
Drain pasta shells. Add them to a casserole dish.
Add pesto sauce, 1 cup ricotta cheese and a handful of grated parmigiano.
Stir carefully and coat the hot pasta with the pesto and cheeses.
Pour the hot tomato and basil sauce over the pasta.
Shred up mozzarella and scatter over the pasta. Add a final sprinkle of parimigiano to the mozarella as well.
Place the casserole under the broiler in the middle of oven, 10-12 inches from the heat. Let the cheese melt and bubble on top (3-5 minutes).