Re-implementation of etlua.