The rise of UKIP, with its fierce opposition to both, came as a profound shock to the BBC mindset.