Outline the contribution of Ibn Khaldin to Islam.