filehelper.lua: Removed logger dependency and redesigned error handling