Key events and lessons from the Prophet's years in Madinah, from the establishment of the Muslim state to the farewell pilgrimage.