Moved the (linear) shape-fitting to a dedicated function in the library

Didn't change anything in the algorithm itself, but as detector sdev is
now 30x lower so lambda must be chosen bigger as well