Serialize objects/arrays in query params with json.dumps() instead of str().

closes #1818