Major upgrade in preparation for Codelet.