Reworked phases.
Reworked phases.

Aims

1) next/prev should be context-independent. Phase now stores
its ContextBase in a field.

2) More robust handling of phaseNamed and the phase properties
erasedTypes, flattened, refchecked, etc. These were previously
dependent on when the first call to any of these methods was made, which
led to a data race.

There is now an init method in phases which centralizes all necessary intialization.
It is checked that a phase is initialized only once.

dotty-staging/dotty,som-snytt/dotty,dotty-staging/dotty,yusuke2255/dotty,sjrd/dotty,som-snytt/dotty,yusuke2255/dotty,dotty-staging/dotty,lampepfl/dotty,som-snytt/dotty,VladimirNik/dotty,som-snytt/dotty,auvik/dotty,sjrd/dotty,dotty-staging/dotty,sjrd/dotty,sjrd/dotty,reactormonk/dotty,folone/dotty,sjrd/dotty,folone/dotty,densh/dotty,reactormonk/dotty,dotty-staging/dotty,vsalvis/dotty,lampepfl/dotty,spetz911/dotty,AlexSikia/dotty,svalaskevicius/dotty,auvik/dotty,VladimirNik/dotty,vsalvis/dotty,lampepfl/dotty,lampepfl/dotty,AlexSikia/dotty,svalaskevicius/dotty,som-snytt/dotty,spetz911/dotty,angi2/dotty,densh/dotty,angi2/dotty,lampepfl/dotty