Add framework for residual generation and CRT construction.