Port of main.cpp to Lua

Some optimization performed already by caching standard functions in locals.
Functioning LuaJIT implementation
Added README