smalloc: implement new v8 api

Implements some of the new v8 API that'll be coming. Hopefully this will
help instantiation time in the long run.