Add CG.

Also prepare for SPD support in `develop' branch.