issue #3836 Refactor Scheduler. Delete some common functions. Rename som...

Refactor Scheduler. Delete some common functions. Rename some common functions then move them to CCCommon.js.