Send commands as JSON, not as forms.

We can't send commands as x-www-form-urlencoded if we want to include more complex types like lists, so send them as JSON.