Bring lentils, stock, 1 3/4 cups water, onion, thyme, bay leaf, salt, and pepper to a boil in a medium saucepan. Reduce heat; simmer, adding water as needed (about 1/2 cup at a time) to prevent lentils from drying out, until they are tender, about 30 minutes. Discard onion, thyme, and bay leaf; set
Meanwhile, heat the oil in a large skillet over medium heat. Add shallots, and cook, stirring often, until golden, 10 to 12 minutes. Add mushrooms;
cook until mushrooms have softened completely and shallots are deep-golden brown, 6 to 8 minutes. Add sherry, stirring to scrape up browned bits. Remove from heat.
Reserve 2 heaping tablespoons of shallot mixture for garnish; refrigerate, covered, until ready to use. Process remaining shallot mixture, the lentils, and nuts in a food processor until coarsely combined. Transfer to a large bowl, and stir in the egg whites.
Line a 5-by-10-inch loaf pan with plastic wrap, allowing 3 inches to hang over each long side. Spoon lentil mixture into pan, and fold plastic over
top. Top with another loaf pan filled with heavy cans. Refrigerate 4 hours (or overnight).
To serve, unwrap top, and invert onto a platter. Bring to room temperature. Garnish with reserved shallot mixture and thyme sprigs. Serve with crackers.
Toast the hazelnuts in a 250-degree oven until fragrant, about 20 minutes. Place them in a clean kitchen towel, and rub to remove the skins.