Perched in a commanding hilltop position above the Tywi Valley, Dinefwr Castle occupies a similarly significant position in Welsh history.