working unit tests for lua
make sanity
minor tweaks and improvements