Full refactoring of compiler.