Added test cases and documentation for json_array_foreach()