Refactor weight function

To make it easier to change the weight function in the future
MultipleCurves: Non-linear weight function

Use quadratic angle -> weight mapping to make sure that
a segment with endpoints at 90 and 90 degrees is preferred over
a segment with one endpoint at a flat line and another at a folded line

*----*
|    |   is preferred over  *===*
*    *
HACK: Avoid infinite recursion.

Hard-coded a repetition limit of 20.
Must implement a proper cycle detection method.
Test case: singleFlames.in with the two dots in the upper-right corner removed.