What was a primary motive behind the implementation of sharia in Islamic empires beginning in the 8th century