Muslims and Hindus have been ordered by the Indian Supreme Court to share a disputed holy site which has caused riots throughout the country and the deaths of more than 3,000 people.