How Riyadh emancipated itself from oil