Two photon microscopy and spectroscopy based on a compact confocal scanning head