build: compile in extra modules

Switch to a two-stage compilation model where we first build a basic
stage0 runtime, then use that to generate FFI bindings for the stage1
modules, like filesystem and process.