Adjust your oven rack to the middle position and preheat the oven to 350°F. Grease and flour two 9-inch pans.
Combine all of the spices in a small bowl; reserve 1/2 teaspoon for the frosting.
Heat 4 tablespoons of the butter in an 8-inch skillet over medium heat until melted, 1 to 2 minutes. Continue to cook, swirling the pan constantly, until the butter is light brown and has a faint nutty aroma, 2 to 4 minutes. Add the spices (make sure you save the 1/2 teaspoon for the frosting) and continue to cook, stirring constantly, 15 seconds. Remove from heat and cool to room temperature, about 30 minutes.
In a medium bowl, whisk together the flour, baking powder, baking soda, and salt. In a small bowl, gently whisk the eggs, yolks and vanilla to combine. In standing mixer fitted with a paddle attachment (or use a hand mixer), cream the remaining 12 tablespoons of butter with the sugar and molasses at medium-high speed until pale and fluffy, about 3 minutes, scraping down sides and bottom of bowl twice with rubber spatula. Reduce to medium speed and add the cooled butter/spice mixture, ginger, and half of egg mixture; mix until incorporated, about 15 seconds. Repeat with the remaining egg mixture; scrape down the bowl again. Reduce to low speed; add about one-third of the flour mixture, followed by half of the buttermilk, mixing just until incorporated after each addition, about 5 seconds. Repeat using half of remaining flour mixture and all of remaining buttermilk. Scrape bowl and add the remaining flour; mix at medium speed until the batter is thoroughly combined, about 15 seconds. Remove the bowl from the mixer and fold the batter once or twice with a rubber spatula to incorporate any remaining flour.
Divide the batter between the prepared pans. Lightly tap against counter 3 or 4 times to dislodge any large air bubbles; smooth the surface with a spatula.
Bake until a toothpick inserted into the center of the cakes comes out clean, 25 to 30 minutes. Cool the cakes to room temperature in the pans on a wire rack, about an hour.
PREPARE THE FROSTING:
In a medium mixing bowl, use a hand mixer to beat the butter, sugar and reserved spice mixture at medium-high speed until light and fluffy, 1 to 2 minutes. Add the cream cheese one piece at a time, beating thoroughly after each addition. Add the vanilla and beat until no lumps remain, about 30 seconds.
Run a paring knife around edge of the cakes to loosen from the pans. Place one layer of the cake on a serving platter. Using a spatula, spread some of the frosting evenly over the surface of cake. Add the second layer, and spread the rest of the frosting on top and on the sides. Sprinkle the cake with walnuts, if using. Cut, and serve.
Notes
This cake may also be made in a 9x13-inch pan. The time will be slightly more- just watch closely until toothpick inserted in center comes out clean.