A Lie algebraic approach to Ricci flow invariant curvature conditions and Harnack inequalities