A comprehensive framework for fluorescence cross-correlation spectroscopy