Move speak class handling to Lua scripts