REF: rename 'labels' in pd.factorize to 'codes'
In ``factorize`` and related stuff, rename ``labels`` to ``codes``. Also add type hints to ``factorize``.

This is an internal name change, so is ok from an API stability perspective
