We develop a theory of the field of double Laurent series, iterated Laurent series, and Malcev-Neumann series that applies to most constant term evaluation problems. These include (i) MacMahon's partition analysis, counting solutions of systems of linear Diophantine equations or inequalities, counting the number of lattice points in convex polytopes, (ii) evaluating combinatorial sums and their generating functions, and proving combinatorial identities, and (iii) lattice path enumeration such as walks on the slit plane and walks on the quarter plane. In the general setting of this new theory, the natural definition of "taking the constant term" of a formal series works well and thus the operators of taking constant terms commute with each other. The proof of Bousquet-Mélou and Schaeffer's conjecture about walks on the slit plane is included. In addition, the counting problem of walks on the half plane avoiding the half line is solved. Jacobi's multivariate residue theorem is generalized to a field of Malcev-Neumann series, which gives a new interpretation and a better understanding of the residue theorem. One application of the residue theorem is a concise proof of Dyson's conjecture. A new algorithm for partial fraction decompositions is developed. This new algorithm is fast and uses little storage space. It also results in an efficient algorithm for MacMahon's partition analysis and related constant term evaluations.