Design and performance of a cesium iodide detector