refactored CmxCanvas.js - renamed variables, cleaned up, added helpers