WIP: Phasing system rework

Work in progress.
Note: Changes done to the `4.3.4` branch to enable testing. Once ready it will be ported to the `6.x` branch.