New code to tidy up log files, reordering stdout by module. Untested.