Lua refactoring: added documentation and manual pages written by Bob Tennent.