1. Beat butter and sugar. Add eggs, one at a time.
2. Beat until sugar has dissolved and batter is smooth.
3. Stir baking powder and baking soda into 2 cups flour and add to batter.
4. Add the remaining ingredients, but do not add all the remaining flour at once.
5. When you get a soft, elastic dough that doesn't stick to your fingers, stop adding flour. You may not use all the flour.
6. Let the dough rest for 30 minutes at room temperature.
7. Preheat oven to 180°C (350°F) mark 4.
8. Line a cookie sheet with parchment paper.
9. Take heaping tablespoonsful of dough, roll in sesame seeds (if desired), and form into S or O shapes.
10. Place cookies onto prepared baking sheet.
11. Beat 1 egg yolk with 1 teaspoon water and brush over cookies.
12. Bake until golden brown.
13. Remove from oven and, if you did not use the sesame seeds, roll cookies in powdered sugar while still warm.