Improve legacy2luatest script.
Merge pull request #1442 from fwalch/improve-legacy2luatest

Improve legacy2luatest script.