Functional State Management and Low-Level Control Flow in JAX