Wash the lentils and place into a pot along with the vegetable broth. Bring to a boil, then reduce heat to medium-low and simmer, for about 40 minutes. Add more broth or water if necessary
Meanwhile, warm the oil in a pan. Add the onions and cook for about 4 minutes or until soft. Add the carrots, bell pepper and garlic. Cook for about 3 minutes more. Set aside.
When the lentils are ready mash them slightly with a potato masher or a fork.
Preheat the oven to 350u00ba F.
In a large bowl, mix the onion mixture, mashed lentils, apple sauce, cranberries, pistachios, bread crumbs, cilantro, chili powder, cumin, thyme, salt and pepper.
Line a loaf pan with parchment paper. Transfer the mixture to the loaf pan and press mixture into the pan with a spoon.
Mix the glaze ingredients in a small bowl and spread evenly over the top.
Bake for about 45 minutes. Transfer the pan to a wire rack and let the loaf cool a bit. Run a table knife around the edge of the pan and turn the loaf out onto a serving plate.