Added "verbose" and "preserveTempFiles" flag to assist with debugging on build servers.
Also synchronized logging to help debugging when using multiple threads.