When running tests with –usecli, unify the conversion from argument objects to strings using a new function arg_to_cli(). This fixes boolean arguments when using named arguments.
Also use json.dumps() to get the string values for arguments that are dicts and lists so that bitcoind’s JSON parser does not become confused.