Moving back from ST to StateP

I moved all the `ST` related stuff back to `StateP`, basically going back to how everything was a month ago, except now working with `pipes` 3.3.0 so that we still have global state support.

I didn't add back the functions `justP` and `justK` that were removed recently.

I haven't tested this, I just made the thing compile, hopefully helping this move forward. Feel free to discard this pull request if you had something different in mind.