removed luajit dependency and upgraded lua code to work with 5.2