TEA: Enabling State-Intensive Network Functions on Programmable Switches