Refactor ComputationGraph and Cost

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