explicit capture/tag in rules, tests in Lua, more logging