Rewrite API, driven by zmachine's needs