Tidy up and flatten session data