Initial version of trace file handling. Still needs some debugging.