Add passes for transforming cps nodes.

This is work in progress. This stuff still needs tests, comments, better names, etc.