Rewrite the UserState.State type to be more idiomatic F#

Instead of a type with members, it's now a type with associated functions.
(It maybe doesn't make a big difference but I want to make sure I'm not
just defaulting to OO style.)