The US and Taliban have signed a historic agreement which sets into motion the drawdown of US troops from Afghanistan and potentially paves the way to ending America's longest-fought war.