Move from json to pickling for comms protocol