Lazy state initialization, ret values from Lua rework

* State must be initialized lazily so we can set flags first
* From Lua, return values are always array. Ugly, but simple.

Signed-off-by: katlogic <kat@lua.cz>