The fintech company behind Square and Cash App is slashing more than 4,000 jobs as AI has made that many people redundant.