Move TransformState code into its own member function, and remove a test that was...