Update unserialize.js

Added functionality to `unserialize`, will automatically detect regular arrays and convert. Unfortunately, this is slightly inefficiency, but it should work fine.