Rewritten large chunks of the matlab code.
Now each data type is its own class and they all inherit from a bass class.
This make it much easier and clearer to add/modify new cost functions.
Merge branch 'dev' of https://github.com/PetterS/curve_extraction into dev