When serialising nested arrays, include the array index for jquery & PHP compatibility