Convert Scheduler to C++

Hi,

The design for converting the scheduler to C++ can be found here

Please review and leave comments if necessary.

Thanks,
Vincent