Refactored BaselineCompiler code to use high level API.