Print the directory in the build error message.
Rework Lua utility functions.
Declare the global scope at the start of files.