Changed dub to not touch global namespace. Some work for lub compatibility.
Compatibility with Lua 5.2
More work to declare all used functions as locals