Update unserialize.js

Autodetect arrays and convert, somewhat inefficient currently