added array-like object serialize support, fixes #5