Split out complexity into helper file

Was duplicated in cintprob/cprob, with different implementations of mult...