Sift flour, baking soda, baking powder, and salt together. Set aside.
Melt 2 ounces unsweetened chocolate and allow to cool.
Wash and dry raisins. Chop walnuts and set both aside.
Cream butter and sugar together.
Add eggs and extracts to butter mixture and beat well.
Add cooled chocolate and mix well.
Add dry ingredients alternately with sour cream. Batter will be very thick.
Stir in raisins and nuts.
Cover and chill well (overnight is best). Batter must be cold to keep the cookies from spreading too much. It is helpful to return the bowl to the refrigerator between batches.
Make frosting before you start baking! Melt chocolate and butter over low heat. Add powdered sugar and cream alternately, stirring between additions. Frosting should be thicker than a glaze, but thinner than a cake frosting. If too thick, add a little cream. Heating frosting will help thin it out. Frosting must be warm when frosting cookies or it will not spread well. Return pan to low burner between batches.
Drop rounded teaspoonsful of batter onto ungreased cookie sheet.
Bake at 400 degrees for about 8 minutes. Cool on cookie sheet about 2 minutes. Long enough for cookies to firm up, but not completely cool.
IMPORTANT STEP: As soon as the cookies are cool enough to handle, frost with warm frosting and set on cooling rack to cool. Frosting will harden as the cookies cool.