Cost and gradient functions merged into single function
Optimizer added, some unnecessary classes removed, gradient and cost classes added, as well as an example on synthetic graph. Nothing is tested yet