Let JSONEncoder handle Numpy data types.

json.JSONEncoder cannot serialize Numpy data types. Numpy arrays
and array scalars have a tolist() method which casts the object to
a standard python data type.