code reorganization to expose lua table <==> string conversions