Add test.lua and clean up some other lua bits.