Add forgotten copy lua scripts code
Move SQL test to separate catalogue, because we can't move it to LUA
Rewrite big tests to lua (as much as possible)
Remove obsolete debug output and pprint import