Moving the various inner phases of the compiler inside the plugin
file.
Due to dependencies of the global environment, those cannot be
defined outside the compilation unit.