Initial patch to support disabling of CAS/CoreCLR.

Based on Sebastien's patch.