Adds type safety for program header indexes. Reduce the amount of state sortPhdrs has access to, helping make the data dependencies clear.