Fix/phases etc

This contains the core fixes for phases and denotation transformers to unblock Dmitry and Tobias