Changed javascript compilation to new runtime API