#62 Refactor stats logging code for tiltyard upload