CQM Module: Framework optimization, cleanup and bug fixes.