A bit of code cleanup

Moderate code cleanup, with one fix for nodegen.lua (missing local scope definition) and
an update to engine.c to test a precondition about the object file extensions.