Implement state monad with Ur/Web functors (module-level functions)