More refactoring and documenting

focusing on CPi.ODE