The current Lua code is full of errors and outdated, causing massive breakage. Closes #30, #29, #26 and #25. Fixed by #36.