Preheat the oven to 200°C, fan 180°C, gas 6. In a medium frying pan, heat 50g of the butter, then add the chopped onion and cook gently for 5-10 minutes. Add the herbs and hazelnuts and cook for a further minute.
Transfer to a bowl and add the breadcrumbs, cranberries, lemon zest and egg, and mix well. Season well with freshly ground black pepper. Push half the stuffing up under the skin at the neck end of the turkey and secure tightly with 4 cocktail sticks. Roll the remaining stuffing mixture into 16 balls and put on to a baking tray lined with greaseproof paper.
Put the remaining onion quarters and the thyme sprigs into the turkey cavity and rub the rest of the butter on top of the bird.
Put the turkey into a large roasting tin and cook in the oven for 30 minutes before turning down the oven to 180°C, fan 160°C, gas 4. Cover the bird with greased foil and roast for a further 3-3½ hours, basting with the turkey juices every 45 minutes, until cooked through. To test whether the turkey is cooked, insert a skewer into the thickest part of the leg – the juices should run clear. Remove the turkey from the oven and allow to rest for 20 minutes covered with foil.
Put the stuffing balls in the oven for 20 minutes while the turkey is resting. Remove and serve with the turkey and other side dishes.