Move serialization and connection tracking out of session.