Refactor PerSessionData a little and add some docs.