A SPAD array detector for spectrally and lifetime resolved microscopy