initial untested draft of the cost learner now complete.
in the middle of fixing problems with the general version of cost learner.