registration[points]: Refactor Hungarian steps.

Move helper functions outside of step functions.