Convert javascript objects into lua table representation