Preheat oven to 400 degrees. Line a baking sheet with parchment paper or a silicone baking mat.
Combine the dates, lemon juice, and 2 tablespoons of water in a saucepan and bring to a boil, stirring occasionally. Remove from heat and stir in the pistachios and, if you want a sweeter cookie, 2 tablespoons of honey or agave. Cover the saucepan and let the mixture cool while preparing the dough.
Combine the flour, tapioca starch, xanthan or guar gum, salt and butter (or butter substitute) in the bowl of a food processor fitted with a steel blade. Process until the mixture resembles fine breadcrumbs. With the machine running, add cold water, one tablespoon at a time until the dough comes together in a soft but not sticky dough. (If dough gets too sticky just dust it with a little more rice flour.) Cut the dough into two even pieces and roll each piece on a lightly floured surface into 12 by 8 inch rectangles. Place one on the prepared baking sheet.
Spread the pistachio date mixture to within ½ inch of the dough edges. Brush the edges with water and top with the remaining sheet of dough. Press to seal the edges. Score the top into 12 even slices with a knife and glaze the top with milk. Bake for 30 -35 minutes or until golden brown. If desired, brush the top with a tablespoon of honey or agave. Let cool on a wire rack.