Minor refactor of how we get compilation phases.

There is now a single function to get the list of phases for a given
output Type.

No functionality change intended.