Update and simplify test/serialize.lua script