Replace pickle with JSON as default encoding

- Pickle doesn't work outside Python
- It's a horribly insecure wire format.
- Lead to accidents like pickling bits of program implementation