lua: Cleanup and documentation fixes.