Adding -fPIC to compilation.
Removing unused definitions.
Correcting stack manipulation.
Adapting to work with Lua 5.0, 5.1 and 5.2.