Artificial intelligence (AI) stocks scored massive wins for investors last year and led the Nasdaq to a double-digit gain.