Huge cleanup and moving into packages sfem and pce.