Pull after blend

First working demo after blending calibration was up and running. Tons of new stuff. Note the streamlined cost functions which make use of templated subroutines
Should we pass the cost_str or an enumeration value (I assumed the strings were only parsed from config files and the enumeration was used internally).