Add a vertical slice of real libuv integration by introducing a "timer" CLI module with a Timer class and static sleep() method. This required significant infrastructure changes: setting up libuv event loop in the CLI, creating a new src/module directory for CLI modules, updating all build scripts (Makefile, wren.mk, Xcode project) to handle the new module compilation, and reorganizing CLI code by moving REPL logic from main.c to vm.c. The generate_builtins.py script was also updated to support copying Wren sources into the module directory.
Add missing free of the old rootDirectory pointer in setRootDirectory to prevent
memory leaks when the function is called multiple times. Also set rootDirectory
to NULL via setRootDirectory after VM teardown in runFile to ensure the pointer
is properly cleared before program exit.
Rename the internal concept from "package" to "module directory" when loading
module.wren files from subdirectories. Update variable names (packageModule
to moduleDir, packageModulePath to moduleDirPath) and adjust early return
logic to free modulePath before checking contents. Add test for loading
module from a directory and remove old package module test.
Extract file path construction into `wrenFilePath` helper and modify `readModule` to first attempt loading the module as a `.wren` file. If that fails, treat the module name as a package directory and try to load `module.wren` from within it. Add test files `module_package/module.wren` and `package_module.wren` to verify the new package resolution behavior.
Extract the static `readFile`, `readModule`, and `setRootDirectory` functions from main.c into a new io module, replacing the fixed-size `rootDirectory` array with a heap-allocated pointer and adding the corresponding header with public declarations.