app.lua: Added selftest() and fixed bugs in configure().