Refactor ComputationGraph and Cost

The `Cost` class was removed. `ComputationGraph` was made fully immutable.

- [x] fix groundhog examples