Preheat the oven to 200°C.
Bring a large pot of water to a boil, salt generously, and boil the pasta until al dente, tender but still slightly firm. Drain.
Toss the cooked pasta with the marinara sauce, cubed mozzarella, half the Parmesan cheese, black pepper, and pepper flakes. Transfer the pasta to an oiled 9 by 13-inch baking dish. Cover the top of the pasta with the sliced mozzarella, and sprinkle with the remaining Parmesan. Bake until lightly browned and hot, about 30 minutes.
Heat the oil in a medium saucepan over medium-high heat. Cook the sausage until beginning to brown, about 3 minutes. Add the onion and garlic, stirring, until lightly browned, about 3 minutes more. Add the tomatoes and the herb sprigs and bring to a boil. Lower the heat and simmer, covered, for 10 minutes.
Remove and discard the herb sprigs. Stir in the salt and season with pepper, to taste. Use now or store covered in the refrigerator for up to 3 days, or freeze for up to 2 months.