Lua scanner, tweaked (finally!)

See #22, #21 for history.