In a large bowl, sift together flour, baking soda, and baking powder. Set aside.
In an electric mixer fitted with the paddle attachment, cream butter and sugar until fluffy. Mix in spices and salt, then eggs and molasses. Add flour mixture; combine on low speed. Divide dough into thirds; wrap in plastic. Chill for at least 1 hour.
Heat oven to 350 degrees. On a floured work surface, roll dough 1/8-inch thick. Cut into desired shapes. Transfer to ungreased baking sheets; refrigerate until firm, 15 minutes. Bake until crisp but not darkened, 8 to 10 minutes. Let cookies cool on wire racks, then decorate with royal icing, if desired.