Initial commit of mage_scheduler replacement code