Miros: a hierarchical state machine module in Lua