port a few functions to the new Lua API
port Fort Lonestar to Lua