Apparently `JSON.encode/decode` is the problem; switching to `cPickle.dumps/loads` helped