algorithm for turning a lua table into a lua loadable string