Partially complete: conversion of code in vm.c into modular functions so that they can be resused in the generated compiled function code