Redesign API: merge Block and CostFunction 

Now we can merge from here, making PR #23 obsolete, ok?