Iraq formally assumes control of security across the country, as US troops withdraw from towns and cities.