Refactor singularities code.

Previously, the curve was unnecessarily transformed in each
function: _multiplicity(), _delta_invariant(), and
_branching_number(). The code was refactored so this
transformation was performed only once per singular point.