Use indexes for array parameters

Serializing an array which contains other arrays/maps gives incorrect results.

```
param = [
    { "foo1" => "bar1", "foo2" => "bar2" },
    { "foo1" => "bar1", "foo2" => "bar2" },
]
```

Should produce

```
param[0][foo1] = bar1
param[0][foo2] = bar2
param[1][foo1] = bar1
param[1][foo2] = bar2
```

Instead of

```
param[][foo1] = bar1
param[][foo2] = bar2
param[][foo1] = bar1
param[][foo2] = bar2
```