Add function to convert params dict to JSON

With parameters sort_keys=True and separators=(',', ':')

Fixes #242
Use new params_dict_to_json function
Merge pull request #301 from adamrp/issue-242

Add params_dict_to_json function