Fixup premature reference to global Lua state
Use Lua references for storing compiled snippets
Fix threaded-perl typo
Add simple debug ENV var during configure stage