General theory of light propagation and triplet generation for studies of spin dynamics and triplet dynamic nuclear polarisation