Refactor ilios.cim.js