Who unified the Mongol clans, built a large army, and created a new legal code