code cleanup, added totals by testtype report, added tids into data structure