The fall of active galactic nuclei and the rise of star-forming galaxies : a close look at the chandra deep field X-ray number counts.