JavaScript: serializeObj