Refactor bib ref normalizing script.