Port QuadExpr, incl. refactoring