Text this: A Categorical Model of State Transformations in Programming Languages