As artificial intelligence spreads, millions of middle-class jobs in human resources, billing and payroll could be at risk.