Added critical section, fps counter, mftrace scripts. Improved sample distribution and handling/recycling.