Lua microoptimizations

In the attempt to solve the performance problem highlighted by issue #8, here are some code optimiziation. The speed improvements are, on my system, negligible but maybe worth a test on other platforms.