move test.lua to the lib dir
move selftest()s to testfiles