object Cofree extends CofreeInstances
add fix utility for functions, and test that it can be used.

Cherry-picking parts of #410 (79e2e36)