Decomposing molecular nonlinear optical properties