refactored iopub messaging to use a thread and started putting an Iocaml API in place