Coherent interactions in on-chip photonic-crystal cavities