Accepts new log format. General code cleanup. (Also multithreaded now!)