Changed serializeArray in Json

It now takes any kinds of Lists as well as Stacks and array in any
nested form.
Fixed small bug of how objects in arrays are printed.